Commit b9c8e870 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile: use 'not defined' rather than 'unnamed' in error message

A receiver type may have an (alias type) name and thus be 'named'
even though the name doesn't refer to a defined type. Adjust the
error message to make this clearer.

Change-Id: I969bf8d1ba3db8820f67f6ecd6d5cfe564c5b80d
Reviewed-on: https://go-review.googlesource.com/112638Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 4826d20a
......@@ -881,7 +881,7 @@ func addmethod(msym *types.Sym, t *types.Type, local, nointerface bool) *types.F
case t == nil || t.Broke():
// rely on typecheck having complained before
case t.Sym == nil:
yyerror("invalid receiver type %v (%v is an unnamed type)", pa, t)
yyerror("invalid receiver type %v (%v is not a defined type)", pa, t)
case t.IsPtr():
yyerror("invalid receiver type %v (%v is a pointer type)", pa, t)
case t.IsInterface():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment