mirror of
https://github.com/golang/go
synced 2025-06-18 18:08:01 +00:00
cmd/gc: fix confusing error when using variable as type.
Fixes #3783. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6737053
This commit is contained in:
@ -476,7 +476,7 @@ reswitch:
|
||||
n->left = N;
|
||||
goto ret;
|
||||
}
|
||||
if(!isptr[t->etype]) {
|
||||
if((top & Erv) && !isptr[t->etype]) {
|
||||
yyerror("invalid indirect of %lN", n->left);
|
||||
goto error;
|
||||
}
|
||||
|
12
test/fixedbugs/issue3783.go
Normal file
12
test/fixedbugs/issue3783.go
Normal file
@ -0,0 +1,12 @@
|
||||
// errorcheck
|
||||
|
||||
// Copyright 2012 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.
|
||||
|
||||
package foo
|
||||
|
||||
var i int
|
||||
|
||||
func (*i) bar() // ERROR "not a type"
|
||||
|
Reference in New Issue
Block a user