if d.decl.Recv.NumFields() == 0 {
// regular function
if d.decl.Recv != nil {
- check.error(d.decl.Recv, _BadRecv, "method is missing receiver")
+ check.error(d.decl.Recv, _BadRecv, "method has no receiver")
// treat as function
}
if name == "init" || (name == "main" && check.pkg.name == "main") {
recv = NewParam(token.NoPos, nil, "", Typ[Invalid]) // ignore recv below
default:
// more than one receiver
- check.error(recvList[len(recvList)-1], _InvalidRecv, "method must have exactly one receiver")
+ check.error(recvList[len(recvList)-1], _InvalidRecv, "method has multiple receivers")
fallthrough // continue with first receiver
case 1:
recv = recvList[0]
func (* /* ERROR "invalid receiver" */ ptr) _() {}
// Methods with zero or multiple receivers.
-func ( /* ERROR "missing receiver" */ ) _() {}
-func (T3, * /* ERROR "exactly one receiver" */ T3) _() {}
-func (T3, T3, T3 /* ERROR "exactly one receiver" */ ) _() {}
-func (a, b /* ERROR "exactly one receiver" */ T3) _() {}
-func (a, b, c /* ERROR "exactly one receiver" */ T3) _() {}
+func ( /* ERROR "method has no receiver" */ ) _() {}
+func (T3, * /* ERROR "method has multiple receivers" */ T3) _() {}
+func (T3, T3, T3 /* ERROR "method has multiple receivers" */ ) _() {}
+func (a, b /* ERROR "method has multiple receivers" */ T3) _() {}
+func (a, b, c /* ERROR "method has multiple receivers" */ T3) _() {}
// Methods associated with non-local or unnamed types.
func (int /* ERROR "cannot define new methods on non-local type int" */ ) m() {}