Source file test/fixedbugs/issue15722.go
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 } 22