Black Lives Matter. Support the Equal Justice Initiative.

Text file src/go/types/testdata/fixedbugs/issue39725.go2

Documentation: go/types/testdata/fixedbugs

     1  // Copyright 2020 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  package p
     6  
     7  func f1[T1, T2 any](T1, T2, struct{a T1; b T2})
     8  func _() {
     9  	f1(42, string("foo"), struct /* ERROR does not match inferred type struct\{a int; b string\} */ {a, b int}{})
    10  }
    11  
    12  // simplified test case from issue
    13  func f2[T any](_ []T, _ func(T))
    14  func _() {
    15  	f2([]string{}, func /* ERROR does not match inferred type func\(string\) */ (f []byte) {})
    16  }
    17  

View as plain text