Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2020-07-20 01:00:41 +0000
committerManoj Palat2020-07-20 01:00:41 +0000
commit9d7c381780b74aa91cbdd6ac5cbc4c20b2605bc8 (patch)
treeb52f6df234e507d7b7ef3036e46bf5c49c89b9d3
parent12cac2354732e0b1e75a0ebb5e1df3f61743ea15 (diff)
downloadeclipse.jdt.core-9d7c381780b74aa91cbdd6ac5cbc4c20b2605bc8.tar.gz
eclipse.jdt.core-9d7c381780b74aa91cbdd6ac5cbc4c20b2605bc8.tar.xz
eclipse.jdt.core-9d7c381780b74aa91cbdd6ac5cbc4c20b2605bc8.zip
Bug 547193 - [switch expression] Unable to compile switch expressionI20200720-0850I20200720-0020
containing try-catch (test) Change-Id: I56d2d0e71982a0f5aa68d08c7ec98015e8e003f7 Signed-off-by: Manoj Palat <manpalat@in.ibm.com>
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java
index 32df1d186f..6bfeff329d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java
@@ -5417,4 +5417,22 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
},
"10");
}
+ public void testBug547193_001() {
+ runConformTest(
+ new String[] {
+ "X.java",
+ "public class X {\n"+
+ " public static void main(String[] args) {\n"+
+ " System.out.println(switch (0) {default -> {\n"+
+ " try {\n"+
+ " yield 1;\n"+
+ " } catch (Exception ex) {\n"+
+ " yield 2;\n"+
+ " }\n"+
+ " }});\n"+
+ " }\n"+
+ "}"
+ },
+ "1");
+ }
}

Back to the top