News for hackers. Stuff that matters.
Re:Why don't more languages offer flow typing? by endtime on Monday April 04, 2022 @11:15AM (#30907618)
Dart does this, or at least something very similar, and it is really nice. It's most useful for narrowing nullable types to their non-nullable counterparts after a null-check, but the subclass case works too.
Re:Why don't more languages offer flow typing? by scns on Monday April 04, 2022 @11:20AM (#30907666)
As your sibling allready stated, in Kotlin it is known as smart casting. Good to see that the article allready recognizes the prior art from ML which was conceived in 1971.
Re:Why don't more languages offer flow typing? by jimbob45 on Monday April 04, 2022 @11:24AM (#30907711)
Dart’s “..” operator, which allows void-returned function calls to be chained, adds no performance cost to the code and is one of my favorite pieces of Dart.