1
0
mirror of https://github.com/golang/go synced 2024-11-24 01:50:11 -07:00

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/112638
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Robert Griesemer 2018-05-10 11:20:35 -07:00
parent 4826d20a09
commit b9c8e870d1

View File

@ -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():