News for hackers. Stuff that matters.
Re:Java record pattern matching in JDK 19 by SemanticStrengh on Saturday May 14, 2022 @01:20PM (#31380164)
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

> 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

Re:Java record pattern matching in JDK 19 by viewfromafar on Saturday May 14, 2022 @02:59PM (#31381188)
The PL crowd calls that type system feature "occurrence typing."
Re:Java record pattern matching in JDK 19 by SemanticStrengh on Saturday May 14, 2022 @03:04PM (#31381230)
yes or flow typing https://en.wikipedia.org/wiki/Flow-sensitive_typing It probably overlap with the research on gradual typing too