3 // Copyright 2017 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.
7 // Test forms of method expressions T.m where T is
21 func (S) m() { got += " m()" }
22 func (S) m1(s string) { got += " m1(" + s + ")" }
26 func (T) m2() { got += " m2()" }
28 type Outer struct{ *Inner }
29 type Inner struct{ s string }
31 func (i Inner) M() string { return i.s }
34 // method expressions with named receiver types
41 // method expressions with literal receiver types
42 f := interface{ m1(string) }.m1
46 interface{ m1(string) }.m1(S{}, "c")
50 interface{ m1(string) }.m1(x, "d")
58 panic("got" + got + ", want" + want)
62 got := h(&Outer{&Inner{"hello"}})
65 panic("got " + got + ", want " + want)