Skip to content

Semiautovivification with slices is broken #847

Description

@rhendric
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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions