Switch Statements and Stack Overflows

Changing the code that derives the enum's == to avoid this problem would mean making the generated AST a lot more complicated. That's not the right answer, not only for that reason, but because it also doesn't solve the problem for other folks who have large switches written by "hand" (typically a generator that isn't the Swift compiler).

The enum derivation logic is fine; the problem needs to be solved at the IR level for all switches.

6 Likes