Skip to content

Design Meeting Notes, 12/8/2023 #56717

@DanielRosenwasser

Description

@DanielRosenwasser

Defining a type predicate breaks inheritance for methods with mapped types

#56133

  • 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

#56271

  • 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

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions