summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-09-01 14:12:09 -0700
committerRuss Cox <rsc@golang.org>2009-09-01 14:12:09 -0700
commit2e5dec38909370ea00882a8c74c864f3bea18400 (patch)
tree332b9335ac2fc3e61a649dfb077b7149f19c072f
parente4cfee6ad94973b6fa33e25e974b24c156404443 (diff)
downloadgolang-2e5dec38909370ea00882a8c74c864f3bea18400.tar.gz
catch package net import "net" for release
R=ken OCL=34205 CL=34207
-rw-r--r--src/cmd/gc/go.y10
-rw-r--r--test/fixedbugs/bug133.dir/bug2.go2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y
index dfee62293..920799ec1 100644
--- a/src/cmd/gc/go.y
+++ b/src/cmd/gc/go.y
@@ -230,6 +230,16 @@ import_package:
pkgimportname = $2;
if(strcmp($2->name, "main") == 0)
yyerror("cannot import package main");
+
+ // TODO(rsc): This is not quite precise enough a check
+ // (it excludes google/util/hash from importing hash)
+ // but it is enough to reduce confusion during the
+ // 2009/09/01 release when all the "import myself"
+ // statements have to go away in programs building
+ // against the release. Once the programs have converted
+ // it should probably just go away.
+ if(strcmp($2->name, package) == 0)
+ yyerror("package cannot import itself (anymore)");
}
import_there:
diff --git a/test/fixedbugs/bug133.dir/bug2.go b/test/fixedbugs/bug133.dir/bug2.go
index 0b8393c93..cfbb558bf 100644
--- a/test/fixedbugs/bug133.dir/bug2.go
+++ b/test/fixedbugs/bug133.dir/bug2.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package bug1
+package bug2
import "./bug1"
import "./bug0"