modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/fixedbugs/issue15722.go (about) 1 // errorcheck 2 3 // Copyright 2016 The Go Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 7 // Checks to make sure that the compiler can catch a specific invalid 8 // method type expression. NB: gccgo and gc have slightly different 9 // error messages, hence the generic test for 'method' and not something 10 // more specific. 11 12 package issue15722 13 14 type T int 15 type P *T 16 17 func (T) t() {} 18 19 func _(p P) { 20 P.t(p) // ERROR "method" 21 }