Skip to content

Arrays initialized with a spread operator on an iterator are empty #534

@thatcosmonaut

Description

@thatcosmonaut
  const items = new Map<number, string>();
  items.set(2, "hello");
  items.set(5, "howdy");
  const new_array = [...items.entries()];

new_array will be empty in Lua.

I understand if this is not planned to be supported, but it would be nice to at least have the transpiler yell at me instead of having to debug an obscure issue in the transpiled code due to the empty array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions