1// compile 2 3// Copyright 2021 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// Make sure that the compiler can analyze non-reflect 8// Type.{Method,MethodByName} calls. 9 10package p 11 12type I interface { 13 MethodByName(string) 14 Method(int) 15} 16 17type M struct{} 18 19func (M) MethodByName(string) {} 20func (M) Method(int) {} 21 22func f() { 23 var m M 24 I.MethodByName(m, "") 25 I.Method(m, 42) 26} 27