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

variable declaration causes weird compiler error #532

Closed
bjkail opened this issue Jan 15, 2010 · 4 comments
Closed

variable declaration causes weird compiler error #532

bjkail opened this issue Jan 15, 2010 · 4 comments

Comments

@bjkail
Copy link

bjkail commented Jan 15, 2010

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 following program:
package main
var m map[int] int = make(map[int] int)
var x, y = m[0]

What is the expected output? What do you see instead?
Expected a working program.  Got:
defn [990f118]
.   AS2MAPR l(3) x(-1000000000) tc(1)
.   AS2MAPR-list
.   .   NAME-x G0 u(1) a(1) l(3) class(1) tc(1) int
.   .   NAME-y G0 u(1) a(1) l(3) class(1) tc(1) bool
.   AS2MAPR-rlist
.   .   INDEXMAP l(3) x(-1000000000) tc(1) int
.   .   .   NAME-m G0 u(1) a(1) l(2) class(1) tc(1) map[int] int
.   .   .   LITERAL-I0 l(3) x(-1000000000) tc(1) int
vardecl2.go:3: fatal error: init1: bad defn


What is your $GOOS?  $GOARCH?
GOOS=linux GOARCH=386


Which revision are you using?  (hg identify)


Please provide any additional information below.
@griesemer
Copy link
Contributor

Comment 1:

Just another datapoint. This seems to work fine with the latest 6g and GOOS=darwin 
and GOARCH=amd64.

@rsc
Copy link
Contributor

rsc commented Jan 15, 2010

Comment 2:

Should have been fixed a few releases ago.
You did not fill out the part of the form that asked
what "hg identify" prints.
Can you please run
cd $GOROOT
hg pull
hg update release
cd src
./all.bash
and let us know whether that fixes the problem.
Thanks.
changeset:   4419:a960713afe07
user:        Russ Cox <rsc@golang.org>
date:        Tue Dec 15 14:26:33 2009 -0800
files:       src/cmd/gc/sinit.c test/fixedbugs/bug227.go
description:
gc: var x, ok = m[y]
Fixes issue #384.
R=ken2
http://golang.org/cl/179061

Labels changed: added compilerbug.

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

Status changed to WaitingForReply.

@bjkail
Copy link
Author

bjkail commented Jan 15, 2010

Comment 3:

Sorry, I didn't have the capacity to bump the version on this machine.  Please go
ahead and cancel this defect.

@rsc
Copy link
Contributor

rsc commented Jan 19, 2010

Comment 4:

Status changed to Fixed.

@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

4 participants