-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Bug Report
π Search Terms
inferred generic widened
π Version & Regression Information
4.3.0-beta
β― Playground Link
Playground link with relevant code
π» Code
type Foo<T extends number> = T extends infer R? Bar<R>: never //compile error: Type 'R' does not satisfy the constraint 'number'
type Bar<T extends number> = neverπ Actual behavior
R was incorrectly widened to no longer be a number, even though it was inferred from T which is a number
π Expected behavior
no error, as R is a number
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript