Source file test/typeparam/issue50481b.dir/main.go

     1  // Copyright 2022 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Test that type substitution and export/import works correctly even for a method of
     6  // a generic type that has multiple blank type params.
     7  
     8  package main
     9  
    10  import (
    11  	"./b"
    12  	"fmt"
    13  )
    14  
    15  func main() {
    16  	foo := &b.Foo[string, int]{
    17  		ValueA: "i am a string",
    18  		ValueB: 123,
    19  	}
    20  	if got, want := fmt.Sprintln(foo), "i am a string 123\n"; got != want {
    21  		panic(fmt.Sprintf("got %s, want %s", got, want))
    22  	}
    23  }
    24  

View as plain text