Skip to content

Fix array.join accepting only string and number elements#887

Merged
Perryvw merged 2 commits intoTypeScriptToLua:masterfrom
ark120202:array-join
May 24, 2020
Merged

Fix array.join accepting only string and number elements#887
Perryvw merged 2 commits intoTypeScriptToLua:masterfrom
ark120202:array-join

Conversation

@ark120202
Copy link
Copy Markdown
Contributor

Fixes #841

return [__TS__IteratorIteratorStep, iterator];
} else {
return ipairs(iterable as readonly T[]);
return ipairs(iterable as readonly T[]) as any;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning behind this as any?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipairs returns a LuaTupleIterator which is incompatible with __TS__Iterator signature. Generally this should be resolved with 880

@Perryvw Perryvw merged commit b3b4a21 into TypeScriptToLua:master May 24, 2020
@ark120202 ark120202 deleted the array-join branch May 24, 2020 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Array.prototype.join doesn't work on tables

2 participants