mirror of
https://github.com/golang/go
synced 2024-11-24 04:40:24 -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:
parent
4826d20a09
commit
b9c8e870d1
@ -881,7 +881,7 @@ func addmethod(msym *types.Sym, t *types.Type, local, nointerface bool) *types.F
|
|||||||
case t == nil || t.Broke():
|
case t == nil || t.Broke():
|
||||||
// rely on typecheck having complained before
|
// rely on typecheck having complained before
|
||||||
case t.Sym == nil:
|
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():
|
case t.IsPtr():
|
||||||
yyerror("invalid receiver type %v (%v is a pointer type)", pa, t)
|
yyerror("invalid receiver type %v (%v is a pointer type)", pa, t)
|
||||||
case t.IsInterface():
|
case t.IsInterface():
|
||||||
|
Loading…
Reference in New Issue
Block a user