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 12package issue15722 13 14type T int 15type P *T 16 17func (T) t() {} 18 19func _(p P) { 20 P.t(p) // ERROR "method" 21} 22