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

Semiautovivification with slices is broken #847

Closed
rhendric opened this Issue Feb 9, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@rhendric
Collaborator

rhendric commented Feb 9, 2016

arr = []
x = arr{}[0, 1] #=> expected [{}, {}], got {}
arr             #=> expected [{}, {}], got [null, null]

The above compiles to

var arr, x, ref$;
arr = [];
x = (ref$ = {}, arr[0] || (arr[0] = ref$[0]), arr[1] || (arr[1] = ref$[1]), ref$);
arr;

but I should get something more like

var arr, x, ref$;
arr = [];
x = [(ref$ = arr)[0] || (ref$[0] = {}), ref$[1] || (ref$[1] = {})];
arr;

right?

This was referenced Jan 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment