1 // Copyright 2021 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 type T1 struct{} 8 func (t T1) m(int) {} 9 var f1 func(T1) 10 11 type T2 struct{} 12 func (t T2) m(x int) {} 13 var f2 func(T2) 14 15 type T3 struct{} 16 func (T3) m(int) {} 17 var f3 func(T3) 18 19 type T4 struct{} 20 func (T4) m(x int) {} 21 var f4 func(T4) 22 23 func _() { 24 f1 = T1 /* ERROR "func(T1, int)" */ .m 25 f2 = T2 /* ERROR "func(t T2, x int)" */ .m 26 f3 = T3 /* ERROR "func(T3, int)" */ .m 27 f4 = T4 /* ERROR "func(_ T4, x int)" */ .m 28 } 29