Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasikanth Bharadwaj2017-02-06 06:49:34 +0000
committerSasikanth Bharadwaj2017-02-09 05:37:42 +0000
commiteb828564b2e82034e080c0c1c42a41a06935acee (patch)
tree7c582879876cfa8c3fb861d017420be187f3448a /org.eclipse.jdt.core.tests.compiler
parent0fc4de15a335d3d8006d7db585d17d3576096101 (diff)
downloadeclipse.jdt.core-eb828564b2e82034e080c0c1c42a41a06935acee.tar.gz
eclipse.jdt.core-eb828564b2e82034e080c0c1c42a41a06935acee.tar.xz
eclipse.jdt.core-eb828564b2e82034e080c0c1c42a41a06935acee.zip
Bug 511676: [1.8] Lambda with inner class defs causes
java.lang.VerifyError: Bad type on operand stack Change-Id: I4f9b1e2fdc278768d958a89e006a7b8a215f145f
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java57
1 files changed, 56 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java
index 369f46d3e7..7450647ab2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 IBM Corporation and others.
+ * Copyright (c) 2015, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1052,6 +1052,61 @@ public void testBug473432() {
"Handled: null\n" +
"null");
}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=511676 [1.8] Lambda with inner class defs causes java.lang.VerifyError: Bad type on operand stack
+public void testBug511676() {
+ this.runConformTest(new String [] {
+ "A.java",
+ "import java.util.function.Function;\n" +
+ "public class A {\n" +
+ " interface C<T> { }\n" +
+ " interface O<T> {\n" +
+ " Object r(C<T> s);\n" +
+ " }\n" +
+ " static <T, R> O<R> m(O<T> source, Function<T, O<R>> mapper) {\n" +
+ " return o -> {\n" +
+ " class D {\n" +
+ " class E {\n" +
+ " }\n" +
+ " E e = new E();\n" +
+ " }\n" +
+ " D d = new D();\n" +
+ " return d.e;\n" +
+ " };\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " m(null, null);\n" +
+ " System.out.println(\" Done\");\n" +
+ " }\n" +
+ "}\n"
+ },
+ "Done");
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=511676 [1.8] Lambda with inner class defs causes java.lang.VerifyError: Bad type on operand stack
+public void testBug511676a() {
+ this.runConformTest(new String [] {
+ "A.java",
+ "public class A {\n" +
+ " interface C<T> { }\n" +
+ " interface O<T> {\n" +
+ " Object r(C<T> s);\n" +
+ " }\n" +
+ " static O<Object> def = o -> {\n" +
+ " class D {\n" +
+ " class E {\n" +
+ " }\n" +
+ " E e = new E();\n" +
+ " }\n" +
+ " D d = new D();\n" +
+ " return d.e;\n" +
+ " };\n" +
+ " public static void main(String[] args) {\n" +
+ " O<Object> o = A.def;\n" +
+ " System.out.println(\" Done\");\n" +
+ " }\n" +
+ "}\n"
+ },
+ "Done");
+}
public static Class testClass() {
return LambdaRegressionTest.class;
}

Back to the top