mirror of
https://github.com/golang/go
synced 2024-11-11 22:40:22 -07:00
gc: suppress non-root cause message for bad receivers.
Fixed issue 2500 R=rsc CC=golang-dev https://golang.org/cl/5485053
This commit is contained in:
parent
c8a5f8841c
commit
6a401339c1
@ -1273,6 +1273,8 @@ addmethod(Sym *sf, Type *t, int local)
|
||||
t = t->type;
|
||||
}
|
||||
}
|
||||
if(t->broke) // rely on typecheck having complained before
|
||||
return;
|
||||
if(t != T) {
|
||||
if(t->sym == S) {
|
||||
yyerror("invalid receiver type %T (%T is an unnamed type)", pa, t);
|
||||
|
12
test/fixedbugs/bug384.go
Normal file
12
test/fixedbugs/bug384.go
Normal file
@ -0,0 +1,12 @@
|
||||
// errchk $G $D/$F.go
|
||||
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Issue 2500
|
||||
|
||||
package foo
|
||||
|
||||
// Check that we only get root cause message, no further complaints about r undefined
|
||||
func (r *indexWriter) foo() {} // ERROR "undefined.*indexWriter"
|
Loading…
Reference in New Issue
Block a user