Skip to content

Conversation

@DanielRosenwasser
Copy link
Member

Fixes #26449

Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'.
Type 'string | number' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => string'.
Copy link
Member

Choose a reason for hiding this comment

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

We could avoid these baseline changes if we choose the last matching invokable instead of the first.

Copy link
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

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

+1 for finding the last signature

@DanielRosenwasser DanielRosenwasser dismissed RyanCavanaugh’s stale review September 5, 2018 22:25

Picking the last type isn't any better, so I don't think it's worth changing the implementation just to maintain baselines. Plus, I would argue picking the first signature is usually more desirable for anonymous arrow types anyway.

@DanielRosenwasser DanielRosenwasser merged commit cf2f339 into master Sep 7, 2018
@DanielRosenwasser DanielRosenwasser deleted the callableErrors branch September 7, 2018 07:06
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants