Skip to content

Array union fix - #243

Merged
Perryvw merged 3 commits into
TypeScriptToLua:masterfrom
tomblind:array_union_fix
Oct 15, 2018
Merged

Array union fix#243
Perryvw merged 3 commits into
TypeScriptToLua:masterfrom
tomblind:array_union_fix

Conversation

@tomblind

Copy link
Copy Markdown
Collaborator

fixes #242

Updated array check to allow unions and intersections that include an array type.

The one edge case I've seen is an intersection of an array type and an object type that defines numeric keys:

declare function foo(): string[] & {[0]: number, [1]: number};
let a = foo();
let b = a[0];

With this change, the index will get a +1. Whether it should or not is a bit ambiguous to me.

@Perryvw
Perryvw merged commit d75cdab into TypeScriptToLua:master Oct 15, 2018
@tomblind
tomblind deleted the array_union_fix branch October 15, 2018 17:29
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 offset is not being applied to unions

2 participants