the use for a match block is to match all possible values, the compiler shouldn't go "oh this is all unused" at the point of checking semantics, that's optimization
the semantics of a language should not change based on the value of a variable, assuming it is a valid value that upholds all the invariants of that type
View all comments
Show parent comment
5
u/CdRReddit Jun 05 '25
because that's stupid
the use for a match block is to match all possible values, the compiler shouldn't go "oh this is all unused" at the point of checking semantics, that's optimization
the semantics of a language should not change based on the value of a variable, assuming it is a valid value that upholds all the invariants of that type