Skip to content

Design Meeting Notes, 4/26/2023 #54038

Closed
Closed
@andrewbranch

Description

@andrewbranch

#54000

  • Inference priority problem between never in empty array and T
  • Difference between inference in two instantiations of same alias and structural algorithm
  • Fixes are likely to be over-targeted corner cases, trading one problem for another
  • Conclusion: do nothing

#53995

  • PR doesn't affect indirect recursive tail calls, only direct self-calls
  • Looks good
  • A function that only tail calls itself and never returns anything else will be never, used to be an error
  • May need to fix an implementation detail, ensuring the call expression expression is identifier

#53999

  • Would we rather revisit the whole set of rules around specifying type parameters on function calls? With this proposal, it seems like we'd always suggest people write preferinfer. Can we just do something like that behavior by default?
    • We could try just using inference instead of defaults on type parameters with defaults, only using the default if no candidates were collected
  • This proposal has a limitation of only omitting trailing arguments, whereas the _ placeholder PR lets any parameter be omitted
  • A modifier on the type parameter doesn't make sense
  • There's something fishy about having a situation where type arguments need to be manually specified anyway
    • There are a lot of poorly designed APIs like this in the wild already
    • Specifying a type argument can be useful in the same kinds of cases where it's useful to explicitly annotate a variable declaration, like setting the element type of an empty array (new Set<string>() comes to mind)
    • People also use additional type parameters with defaults as scoped type aliases
  • Worth looking at _ proposal again, or even just always allowing partial tye argument specification (in expression positions)
    • Type argument arity is first pass of overload selection 😬
  • Conclusion: update the _ PR, run RWC, see what happens

#54005

  • Maybe Jake broke it
  • Oops we're not actually prepared to talk about this one
  • At least typescript-bot successfully bisected it
  • In an ideal world we'd be able to try both and see which one works
  • Conclusion: Anders would like to look at it

#53970

  • Someone is relying on an implementation detail of when we resolve indexed access type to make a higher-order polymorphism mechanism
  • We now defer reduceable intersection types when they occur in indexed access types
  • The deferral is kind of the right thing to do, but it breaks the example
  • (F & { readonly A: A })['type'] used to reduce to F['type'] without acknowledging that the intersection could produce never
  • We could potentially fix this by doing the intersection reduction (A & B)[C] to A[C] & B[C] during inference and inferring from both

#54011

  • Needed for a version of Monaco that doesn't bundle TS so you can dynamically figure out what libs are available
  • Might be more future-proof to expose it as a function instead
  • Can you not just read all the file names in typescript/lib?
    • No, because you might be getting TS files from a CDN, and there's not necessarily a consistent way to get a listing

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