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

Invalid behaviour in assignments with slice indexing on left side #892

Open
zapateo opened this issue Sep 30, 2021 · 0 comments
Open

Invalid behaviour in assignments with slice indexing on left side #892

zapateo opened this issue Sep 30, 2021 · 0 comments
Labels
bug Bug: something already implemented does not work as it should InvalidBehavior A valid or not valid code has an invalid behavior at runtime needsInvestigation Need to investigate

Comments

@zapateo
Copy link
Member

zapateo commented Sep 30, 2021

This code:

package main

import "fmt"

func main() {
	x := []int{1, 2, 3}
	i := 0
	i, x[i] = 1, 100
	fmt.Println(x)
}

should print:

[100 2 3]

but intestead it prints:

[1 100 3]

Note: this issue may be related to #534.

@zapateo zapateo added bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate InvalidBehavior A valid or not valid code has an invalid behavior at runtime labels Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug: something already implemented does not work as it should InvalidBehavior A valid or not valid code has an invalid behavior at runtime needsInvestigation Need to investigate
Projects
None yet
Development

No branches or pull requests

1 participant