| // Copyright 2017 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Test forms of method expressions T.m where T is |
| func (S) m() { got += " m()" } |
| func (S) m1(s string) { got += " m1(" + s + ")" } |
| func (T) m2() { got += " m2()" } |
| // method expressions with named receiver types |
| // method expressions with literal receiver types |
| f := interface{ m1(string) }.m1 |
| interface{ m1(string) }.m1(S{}, "c") |
| interface{ m1(string) }.m1(x, "d") |
| panic("got" + got + ", want" + want) |