From: Russ Cox Date: Fri, 3 Apr 2009 04:46:19 +0000 (-0700) Subject: special case check for this situation X-Git-Tag: weekly.2009-11-06~1899 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=39436f2a747bc1c64f50c8be46cd9cf801576ba8;p=gostls13.git 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 --- diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y index d6155f9f24..9cd7de1162 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)