Skip to content

Conversation

weswigham
Copy link
Member

Specifically when the target has the same or more arguments than the source, this way the signature with a greater number of more specific arguments becomes the backing signature for a union signature.

Fixes #28575

@@ -118,15 +114,13 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2
var unionWithOptionalParameter3: { (a: string, b?: number): string; } | { (a: string): number; };
strOrNum = unionWithOptionalParameter3('hello');
strOrNum = unionWithOptionalParameter3('hello', 10); // error no call signature
Copy link
Member

Choose a reason for hiding this comment

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

remove error comment, and edit the next one to say something like // bad argument type

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Looks good, just need to update some comments after errors.

@weswigham weswigham merged commit 96937fd into microsoft:master Nov 20, 2018
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.

2 participants