3 ms·
using an instance of a sealed class in a switch expression also has the nice property that the compiler will produce an error if the cases are incomplete (and a
by tpoacher 10mo ago
using an instance of a sealed class in a switch expression also has the nice property that the compiler will produce an error if the cases are incomplete (and as such there's also no need for a default case). So a good case for the "make invalid states unrepresentable" argument.