The answer is simple: because other languages don't need it - they have different features to deal with it. The author even mentions it: pattern matching. Just that he picks a language that doesn't support union-types. But that doesn't mean that flow typing would be necessary here - it means that the language(s) should support union-types and extend their pattern matching accordingly. In fact, I would say that flow t…
sealed interface Foo permits Impl {} // union type
record Impl() implements Foo {} // product type
T m(Foo foo) {
return switch(foo) {
case Impl impl -> "hello"; // flow typing T=String
};
}