Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thomann2019-02-22 03:14:39 +0000
committerManoj Palat2019-02-22 03:14:39 +0000
commit41e7973f4d4b6a9095b746124a1174ca3bfcbd5a (patch)
treea464175754c541fed3f04bdf9bdbc6a9d8153bb3 /org.eclipse.jdt.core.tests.compiler/src
parentce88cb13b15fbd28376cd9f9cc3207043563910e (diff)
downloadeclipse.jdt.core-41e7973f4d4b6a9095b746124a1174ca3bfcbd5a.tar.gz
eclipse.jdt.core-41e7973f4d4b6a9095b746124a1174ca3bfcbd5a.tar.xz
eclipse.jdt.core-41e7973f4d4b6a9095b746124a1174ca3bfcbd5a.zip
Bug 544556 - [12] [codegen] Switch expression - Operand Stack Overflow -Y20190222-0110
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java
index 29bc46acfa..512af7f814 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionTest.java
@@ -2104,4 +2104,30 @@ public class SwitchExpressionTest extends AbstractRegressionTest {
null,
new String[] {"--enable-preview"});
}
+ public void testBug544556() {
+ runConformTest(
+ new String[] {
+ "X.java",
+ "public class X {\n" +
+ " public int foo(int i) {\n" +
+ " @SuppressWarnings(\"preview\")\n" +
+ " int v =\n" +
+ " switch(switch(i) {\n" +
+ " case 0 -> { break 2; }\n" +
+ " default -> { break 3; }\n" +
+ " }) {\n" +
+ " case 0 -> { break 0; }\n" +
+ " default -> { break 1; }\n" +
+ " };\n" +
+ " return v == 1 ? v : 0;\n" +
+ " }\n" +
+ " public static void main(String[] argv) {\n" +
+ " System.out.println(new X().foo(0));\n" +
+ " }\n" +
+ "}"
+ },
+ "1",
+ null,
+ new String[] {"--enable-preview"});
+ }
} \ No newline at end of file

Back to the top