Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global var value, valueOK = valueMap[valueKey] issue #384

Closed
gopherbot opened this issue Dec 5, 2009 · 2 comments
Closed

Global var value, valueOK = valueMap[valueKey] issue #384

gopherbot opened this issue Dec 5, 2009 · 2 comments

Comments

@gopherbot
Copy link

by malkia:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Compile the provided sample
2. Notice the compiler reports a fatal error with some internal messages.

What is the expected output? What do you see instead?
- Correct output woudl be no output, which means the compilation succeeded.
- Instead, I'm getting this:
defn [1002aeb28] 
.   AS2MAPR l(9) x(-1000000000) tc(1) 
.   AS2MAPR-list 
.   .   NAME-shortarch G0 u(1) a(1) l(9) class(1) tc(1) string 
.   .   NAME-shortarchOK G0 u(1) a(1) l(9) class(1) tc(1) bool 
.   AS2MAPR-rlist 
.   .   INDEXMAP l(9) x(-1000000000) tc(1) string 
.   .   .   NAME-archmap G0 u(1) a(1) l(6) class(1) tc(1) map[string] 
string 
.   .   .   NAME-longarch G0 u(1) a(1) l(7) class(1) tc(1) string 
map-bug.go:15: fatal error: init1: bad defn 


What is your $GOOS?  $GOARCH?
GOOS=darwin
GOARCH=amd64

Which revision are you using?  (hg identify)
4333:6892511bb0df 

Please provide any additional information below.
I'm providing you with a source file that reproduces the problem.

// map-bug.go

package main 

import ( "fmt"; "os") 

var ( 
        archmap = map[string]string{"Xamd64":"6", "x86":"8", "arm":"5"}; 
        longarch = os.Getenv("GOARCH"); 
        curdir, curdirOK = os.Getwd();               // Here curdirOK is fine 
        shortarch, shortarchOK = archmap[longarch];  // Here shortarchOK troubles the compiler. 
) 

func main() 
{ 
        fmt.Println("shortarch=" + shortarch); 
}
@rsc
Copy link
Contributor

rsc commented Dec 10, 2009

Comment 1:

Labels changed: added compilerbug.

Owner changed to r...@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Dec 15, 2009

Comment 2:

This issue was closed by revision 0282cc5.

Status changed to Fixed.

Merged into issue #-.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants