4 ms·
I wrote a compiler extension to help me: https://github.com/abjennings/EnumAnalyzer https://github.com/abjennings/EnumAnalyzer It doesn't analyze the control
by ajennings 9y ago
I wrote a compiler extension to help me:
https://github.com/abjennings/EnumAnalyzer https://github.com/abjennings/EnumAnalyzer
It doesn't analyze the control flow or anything like that. It just looks for places where I throw a certain exception, then checks the surrounding code block to make sure all the defined enum values are mentioned at least once.
It definitely doesn't handle all the corner cases. But I think it's 90% of the benefit for 10% of the cost. Also, I learned to write compiler extensions...