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

array generate golang code init error #670

Closed
visualfc opened this issue Feb 1, 2021 · 0 comments · Fixed by #672
Closed

array generate golang code init error #670

visualfc opened this issue Feb 1, 2021 · 0 comments · Fixed by #672
Labels

Comments

@visualfc
Copy link
Member

visualfc commented Feb 1, 2021

Go+ code

a := [2]int{}
a[0] = 2
println("a:", a[0])

generate Golang code a = 0, 0, [2]int{}

package main

import fmt "fmt"

var a [2]int

func main() { 
//line ./main.gop:2
	a = 0, 0, [2]int{}
//line ./main.gop:3
	(&a)[0] = 2
//line ./main.gop:4
	fmt.Println("a:", a[0])
}
visualfc added a commit to visualfc/gop that referenced this issue Feb 1, 2021
@xushiwei xushiwei added the bug label Mar 4, 2021
xushiwei added a commit that referenced this issue Mar 4, 2021
fix #668 #669 #670 #671 load addr and slice/array error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants