3 ms·
By turning the "else if" into an "if" you introduce a silent bug when Color.yellow is added, since the final else clause would now have to deal with both blue a
by parenthephobia 9y ago
By turning the "else if" into an "if" you introduce a silent bug when Color.yellow is added, since the final else clause would now have to deal with both blue and yellow correctly.
Adding a new member to the Color enum should break code that isn't written to handle it: which is any code written before Color.yellow was introduced.
- ajennings 9y agoCreated a compiler extension to help me: https://github.com/abjennings/EnumAnalyzer https://github.com/abjennings/EnumAnalyzer