|
|
|
|
|
by rf15
44 days ago
|
|
I disagree - the problem lies with the intention of exhaustively listing all available values in a switch expression with no backup plan. Switch expressions should always have a default/fallback branch, even if it's theoretically impossible and only logs the attempt/picks a default for future proofing the code and its uses. |
|
This will nullify the advantage of being able to treat sealed classes as algebraic datatypes by using the exhaustiveness check.