1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // This file contains test cases for various forms of
6 // method receiver declarations, per the spec clarification
7 // https://golang.org/cl/142757.
11 // test case from issue28251
18 func _() { (&T{}).m() }
20 // various alternative forms
25 func ((*(T1))) m1() {}
26 func _() { (T{}).m2() }
27 func _() { (&T{}).m2() }
35 func _() { (T{}).m2() }
36 func _() { (&T{}).m2() }
44 func _() { (T{}).m4 /* ERROR "cannot call pointer method m4 on T" */ () }
45 func _() { (&T{}).m4() }
54 func _() { (T{}).m6 /* ERROR "cannot call pointer method m6 on T" */ () }
55 func _() { (&T{}).m6() }
63 func (T9 /* ERROR "invalid receiver type **T" */ ) m9() {}
64 func _() { (T{}).m9 /* ERROR "has no field or method m9" */ () }
65 func _() { (&T{}).m9 /* ERROR "has no field or method m9" */ () }