-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Design NotesNotes from our design meetingsNotes from our design meetings
Description
Defining a type predicate breaks inheritance for methods with mapped types
- Types fail to relate to each other because the apparent type is used.
- Last time, suggestion was to infer between mapped types before inferring from apparent types.
- PR at Infer between generic mapped types before inferring from apparent type #56640 does this, but could cause issues where inferring apparent types would have been better than from the mapped type.
- Specific example of a homomorphic mapped type inferring from a mapped type where the constraint type is array-like.
- Do we feel like this is too breaky?
- Can find ways to ensure that these types infer appropriately based on if the constraint is array-like.
- There are questions about if the constructed example should even have been allowed.
- Probably will go ahead with currently-implemented behavior in Infer between generic mapped types before inferring from apparent type #56640
Parentheses Affecting Conditional Type Distributivity
- Always said you can stop distributivity in [square brackets].
type MapNumbers<T> = [T] extends [number] ? ... : ...- Some weirdnesses around TypeScript doing the same with parentheses.
- It shouldn't, right?
- Probably
- Parentheses shouldn't affect semantics.
Metadata
Metadata
Assignees
Labels
Design NotesNotes from our design meetingsNotes from our design meetings