Commit d7a3407e authored by Daniel Morsing's avatar Daniel Morsing

cmd/gc: fix confusing error when using variable as type.

Fixes #3783.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6737053
parent a7a3fe72
......@@ -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;
}
......
// 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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment