Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(40)

Unified Diff: src/cmd/gc/go.y

Issue 194071: code review 194071: eliminate package global name space (Closed)
Patch Set: code review 194071: eliminate package global name space Created 15 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/cmd/gc/lex.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/gc/go.y
===================================================================
--- a/src/cmd/gc/go.y
+++ b/src/cmd/gc/go.y
@@ -237,14 +237,13 @@
importpkg->name = $2->name;
importpkg->direct = 1;
- // PGNS: fixme
+ // NOTE(rsc): This is no longer a technical restriction:
+ // the 6g tool chain would work just fine without giving
+ // special meaning to a package being named main.
+ // Other implementations might need the restriction
+ // (gccgo does), so it stays in the language and the compiler.
if(strcmp($2->name, "main") == 0)
yyerror("cannot import package main");
-
- // PGNS: This should go away once we get
- // rid of the global package name space.
- if(localpkg->name && strcmp($2->name, localpkg->name) == 0 && !compiling_runtime)
- yyerror("package cannot import itself");
}
import_there:
« no previous file with comments | « no previous file | src/cmd/gc/lex.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b