From c715b58dadfce3647dc33c60c276f1b557f08612 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 15 Dec 2009 16:44:28 -0800 Subject: [PATCH] gc: fix import name resolution Fixes #403. R=ken2 https://golang.org/cl/180052 --- src/cmd/gc/go.y | 2 +- test/fixedbugs/bug233.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/fixedbugs/bug233.go diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y index 6d86a6a99fa..35e7742d968 100644 --- a/src/cmd/gc/go.y +++ b/src/cmd/gc/go.y @@ -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 index 00000000000..31bb673ebd6 --- /dev/null +++ b/test/fixedbugs/bug233.go @@ -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