mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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:
parent
4826d20a09
commit
b9c8e870d1
1 changed files with 1 additions and 1 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue