]> Cypherpunks repositories - gostls13.git/commitdiff
gc: fix import name resolution
authorRuss Cox <rsc@golang.org>
Wed, 16 Dec 2009 00:44:28 +0000 (16:44 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 16 Dec 2009 00:44:28 +0000 (16:44 -0800)
Fixes #403.

R=ken2
https://golang.org/cl/180052

src/cmd/gc/go.y
test/fixedbugs/bug233.go [new file with mode: 0644]

index 6d86a6a99fa94262108917a2167d954aecbefbed..35e7742d96869dae4a96f2fe7752dfa584e04bfb 100644 (file)
@@ -195,7 +195,7 @@ import_stmt:
                }
                my->def = pack;
                my->lastlineno = $1;
-               import->block = 1;      // at top level
+               my->block = 1;  // at top level
        }
 
 
diff --git a/test/fixedbugs/bug233.go b/test/fixedbugs/bug233.go
new file mode 100644 (file)
index 0000000..31bb673
--- /dev/null
@@ -0,0 +1,10 @@
+// $G $D/$F.go
+
+// Copyright 2009 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+import p "fmt"
+var _ = p.Print
+var fmt = 10