Skip to content

Commit

Permalink
(WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Apr 29, 2024
1 parent 92edc21 commit 73fbbb9
Showing 1 changed file with 23 additions and 0 deletions.
Expand Up @@ -34,6 +34,9 @@ public static void main(String[] args) {
exhaustiveSwitchExpression(Stubs.Enum.B);
exhaustiveSwitchExpression(Stubs.Enum.C);

exhaustiveSwitchExpressionWithYield(Stubs.Enum.A);
exhaustiveSwitchExpressionWithYield(Stubs.Enum.B);
exhaustiveSwitchExpressionWithYield(Stubs.Enum.C);
}

private static void switchExpressionWithArrows() {
Expand Down Expand Up @@ -108,4 +111,24 @@ private static void exhaustiveSwitchExpression(Stubs.Enum e) {
}); // assertEmpty()

}

private static void exhaustiveSwitchExpressionWithYield(Stubs.Enum e) {

nop(switch(e) { // assertFullyCovered(0, 3)
case A -> {
nop();
yield i1(); // assertFullyCovered()
}
case B -> {
nop();
yield i1(); // assertFullyCovered()
}
case C -> {
nop();
yield i1(); // assertFullyCovered()
}
});

}

}

0 comments on commit 73fbbb9

Please sign in to comment.