summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-04-02 21:46:19 -0700
committerRuss Cox <rsc@golang.org>2009-04-02 21:46:19 -0700
commit859da0292b8384192cf0c03e3983e2c2115cb64e (patch)
tree50e590f70663f83b3cb066487d806eaac1470324 /src
parentd8bac5e8038c0b01c59ae1923e3cc70e293c959a (diff)
downloadgolang-859da0292b8384192cf0c03e3983e2c2115cb64e.tar.gz
special case check for this situation
; cat >http.go package main import "http" // intended the library, not this file ^D ; 6g http.go ; 6g http.go http.go:4: export/package mismatch: init ; new error: http.6:7 http.go:3: cannot import package main R=ken OCL=27053 CL=27053
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gc/go.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y
index d6155f9f2..9cd7de116 100644
--- a/src/cmd/gc/go.y
+++ b/src/cmd/gc/go.y
@@ -173,6 +173,9 @@ import_package:
{
pkgimportname = $2;
+ if(strcmp($2->name, "main") == 0)
+ yyerror("cannot import package main");
+
// if we are not remapping the package name
// then the imported package name is LPACK
if(pkgmyname == S)