Commit Graph

8 Commits

Author SHA1 Message Date
Chris Smowton
568bddc4a9 Add test cases for cases falling directly out of switch blocks 2024-03-25 16:31:40 +00:00
Chris Smowton
f317f782ae Add test for control-flow with mixed patterns, constants and fall-through 2024-03-25 16:31:38 +00:00
Chris Smowton
6cf956d07a Add CFG test for anonymous variables and fall-throughs with pattern cases 2024-03-25 16:31:38 +00:00
Chris Smowton
05addde957 Adapt control-flow graph to record patterns 2023-11-30 11:24:00 +00:00
Chris Smowton
144218e2f7 Implement switch CFG when there are mixed constant and pattern cases 2023-11-30 11:23:59 +00:00
Chris Smowton
54a89d6fef Handle 'case null, default:' 2023-11-30 11:23:59 +00:00
Chris Smowton
2b16121638 CFG: Support guarded patterns 2023-11-30 11:23:59 +00:00
Chris Smowton
6c990c2cf6 Add pattern-case support and generally debug switch CFGs
These were reasonably broken beforehand, due to not taking switch rules into account in enough places, and confusing the expression/statement switch rule distinction with the distinction between switch statements and expressions.

(For example, `switch(x) { 1 -> System.out.println("Hello world") ... }` is a statement, but has a rule expression).
2023-11-30 11:23:58 +00:00