Commit d3094969 authored by Brendan Daniel Tracey's avatar Brendan Daniel Tracey Committed by Russ Cox

cmd/gc: change compile error to "use of package %S without selector"

At present, when a package identifier is used outside of a selector expression, gc gives the error "use of package %S outside selector". However, in the selector expression x.f, the spec defines f as the selector. This change makes the error clearer.

Fixes #7133.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/50060047
parent d98dc0e8
...@@ -368,7 +368,7 @@ reswitch: ...@@ -368,7 +368,7 @@ reswitch:
goto ret; goto ret;
case OPACK: case OPACK:
yyerror("use of package %S not in selector", n->sym); yyerror("use of package %S without selector", n->sym);
goto error; goto error;
case ODDD: case ODDD:
......
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