4 ms·
Can't speak for all languages and usecases, but at least in Scala its primary use (afaik) is to enable the compiler to reason about the correctness of an applic
by dominikbucher 6y ago
Can't speak for all languages and usecases, but at least in Scala its primary use (afaik) is to enable the compiler to reason about the correctness of an application (i.e., it knows all the possible subclasses of a class and can tell you if you forgot to handle some case). I think this is also useful in other languages if you have some logic somewhere that depends on knowing all possible subclasses of a class (independent of the compiler generating warnings or not).