2 ms·
Don't be mistaken, Typescript do not has proper pattern matching support, The proposal is far from being adopted https://github.com/tc39/proposal-pattern-matchi
by SemanticStrengh 4y ago
Don't be mistaken, Typescript do not has proper pattern matching support,
The proposal is far from being adopted https://github.com/tc39/proposal-pattern-matching https://github.com/tc39/proposal-pattern-matching
> Related, Typescript is the only language I know of that through flow analysis does not require you to redefine the variable. E.g. you can do something like
This is called smart casting and is widely used in Kotlin
- viewfromafar 4y agoThe PL crowd calls that type system feature "occurrence typing."
- SemanticStrengh 4y agoyes or flow typing https://en.wikipedia.org/wiki/Flow-sensitive_typing https://en.wikipedia.org/wiki/Flow-sensitive_typing It probably overlap with the research on gradual typing too