...

Source file src/internal/types/testdata/fixedbugs/issue67628.go

Documentation: internal/types/testdata/fixedbugs

     1  // Copyright 2024 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 f[P any](x P) P { return x }
     8  
     9  func _() {
    10  	type A = int
    11  	var a A
    12  	b := f(a) // type of b is A
    13  	// error should report type of b as A, not int
    14  	_ = b /* ERROR "mismatched types A and untyped string" */ + "foo"
    15  }
    16  

View as plain text