Closed tustin2121 closed 4 years ago
Good catch. I don't have any tests for this type of default
usage, but I do remember taking this into account when it was implemented. Either way, I'll look into it this weekend.
Fixed in 4b0e526111bd74d15ca50098ae057d1b199251c3
Available in Release 2.8.1
@tustin2121 The playground is also updated, if you want to check that out.
Something appears to be wrong with switch parsing, such that the output code involving a default case is downright wrong. It seems like it is not handling the default case as a normal "case" like you'd expect from a higher level language with such a concept, but as something separate entirely. Either this should be fixed or the behavior should be made plain in the documentation.
Found in an earlier version, verified in the playground.
Input code:
Expected output (unoptimised):
Actual output (unoptimised):
Input code:
Expected output (unoptimised):
Actual output (unoptimised):