1
0
mirror of https://github.com/golang/go synced 2024-11-22 05:34:39 -07:00

bug: package name not visible

R=r
OCL=13898
CL=13898
This commit is contained in:
Robert Griesemer 2008-08-05 16:09:49 -07:00
parent 28547615ce
commit 044a3b1a5e
2 changed files with 35 additions and 4 deletions

27
test/bugs/bug085.go Normal file
View File

@ -0,0 +1,27 @@
// errchk $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 P
var x int
func foo() {
print P.x; // P should be defined between the outermost "universe" scope and the global scope
}
/*
uetli:~/Source/go1/test/bugs gri$ 6g bug085.go
bug085.go:6: P: undefined
Bus error
*/
/* expected scope hierarchy (outermost to innermost)
universe scope (contains predeclared identifiers int, float, int32, len, etc.)
"solar" scope (just holds the package name P so it can be found but doesn't conflict)
global scope (the package global scope)
local scopes (function scopes)
*/

View File

@ -211,10 +211,10 @@ inner loop top i 0
do break
outer loop top k 1
k not zero
panic on line 305 PC=0x1362
panic on line 310 PC=0x1362
0x1362?zi
main·main(1, 0, 1606414952, ...)
main·main(0x1, 0x7fff5fbff268, 0x0, ...)
main·main(1, 0, 1606416392, ...)
main·main(0x1, 0x7fff5fbff808, 0x0, ...)
BUG: crashes
=========== bugs/bug072.go
@ -255,6 +255,10 @@ BUG: fails incorrectly
=========== bugs/bug083.go
=========== bugs/bug085.go
bugs/bug085.go:8: P: undefined
BUG: fails incorrectly
=========== fixedbugs/bug000.go
=========== fixedbugs/bug001.go
@ -318,7 +322,7 @@ fixedbugs/bug035.go:7: var f redeclared in this block
=========== fixedbugs/bug037.go
fixedbugs/bug037.go:6: vlong: undefined
fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(301) t=<T> nil
fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(306) t=<T> nil
=========== fixedbugs/bug038.go