Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 234130 Details for
Bug 412650
[1.8][compiler]Incongruent Lambda Exception thrown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for the fix
Bug-412650.patch (text/plain), 2.90 KB, created by
ANIRBAN CHAKRABORTY
on 2013-08-06 14:47:05 EDT
(
hide
)
Description:
Patch for the fix
Filename:
MIME Type:
Creator:
ANIRBAN CHAKRABORTY
Created:
2013-08-06 14:47:05 EDT
Size:
2.90 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java >index 89c2806..aa488ad 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java >@@ -6847,9 +6847,41 @@ > null /* no extra class libraries */, > true /* flush output directory */, > null /* custom options */ > ); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=412650 >+// [1.8][compiler]Incongruent Lambda Exception thrown >+public void test412650() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "package test;\n" + >+ "import static test.Y.*;\n" + >+ "public class X {\n" + >+ " public void foo() {\n" + >+ " Y<String> generated = cons(\"a\", () -> cons(\"b\", Y::<String>empty));\n" + >+ " }\n" + >+ "}\n", >+ "Y.java", >+ "package test;\n" + >+ "import java.util.function.Supplier;\n" + >+ "public abstract class Y<E> {\n" + >+ " public static <E> Y<E> empty() { return null;}\n" + >+ " public static <E> Y<E> cons(E head, Supplier<Y<E>> tailFun) {return null;}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 5)\n" + >+ " Y<String> generated = cons(\"a\", () -> cons(\"b\", Y::<String>empty));\n" + >+ " ^^^^^^^^^^^^^^^^\n" + >+ "The type of empty() from the type Y is Y<Object>, this is incompatible with the descriptor's return type: Y<E>\n" + >+ "----------\n", >+ null /* no extra class libraries */, >+ true /* flush output directory */, >+ null /* custom options */ >+ ); >+} > public static Class testClass() { > return NegativeLambdaExpressionsTest.class; > } > } >\ No newline at end of file >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java >index 1fdae07..342785e 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java >@@ -575,10 +575,12 @@ > setExpectedType(left); > IErrorHandlingPolicy oldPolicy = this.enclosingScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy); > try { > this.binding = null; > resolveType(this.enclosingScope); >+ } catch (IncongruentLambdaException e) { >+ return false; > } finally { > this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy); > isCompatible = this.binding != null && this.binding.isValidBinding(); > if (isCompatible) { > if (this.resultExpressions == null)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 412650
:
233548
|
233550
|
234130
|
234181