Skip to content
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

Accept Iterable|ArrayLike union in Array.from, add tests #20467

Merged
merged 1 commit into from
Dec 8, 2017

Conversation

Jessidhia
Copy link

Fixes #20432, and adds extra tests for #19682. The PR at #19693 that initially closed #19682 accidentally also fixed the incorrect inference that was making the // expect error cases not error.


const result1: A[] = Array.from(inputA);
const result2: A[] = Array.from(inputA.values());
const result3: B[] = Array.from(inputA.values()); // expect error
Copy link
Author

Choose a reason for hiding this comment

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

This would not error out if mapfn was optional instead of an extra parameter in an overload

@DanielRosenwasser DanielRosenwasser merged commit 8d209a3 into microsoft:master Dec 8, 2017
@Jessidhia Jessidhia deleted the array-from-union-fix branch December 8, 2017 02:44
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants