You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can be more conservative later, but if you think about it from the perspective of no constraint (where it's implicitly {}), then really any type should be assignable to subset T in those scenarios.
Non-properties
Index Signatures
interfaceFoo{[x: string]: string;}// Effectively the same as '{ [x: string]: string | undefined }'.letqq: subsetFoo={};qq["blah"]="okay?";
Control Flow Analysis for Array Construction (#11432)
AH: Improving furthur on un-annotated initializers, we have expanded our logic to "evolve" the type of an empty array.
This evolution "stacks".
Junctions have interesting cases with constructions of exclusive types.
Subset Types (#11233)
Name is up for debate & bikeshedding.
Problem is that users excess property checking can be lost through intermediate assignments
Generics
What happens when you have a partial type parameter in a function?
Resolution: Only things that are assignable to
subset T
areT
subset T
any
.What about this?
Resolution: Not allowed.
Why?
We can be more conservative later, but if you think about it from the perspective of no constraint (where it's implicitly
{}
), then really any type should be assignable tosubset T
in those scenarios.Non-properties
Index Signatures
Name of
Resolution:
subset
Extensibility (#10159)
More of a meta discussion.
Uses
All are in some way related to language service.
Pros
Great tooling, allows different libraries & frameworks to give an augmented experience.
Cons
Status
Unresolved.
The text was updated successfully, but these errors were encountered: