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 234181 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 accommodating the review comments
Bug-412650--new.patch (text/plain), 2.61 KB, created by
ANIRBAN CHAKRABORTY
on 2013-08-08 03:06:19 EDT
(
hide
)
Description:
patch for the fix accommodating the review comments
Filename:
MIME Type:
Creator:
ANIRBAN CHAKRABORTY
Created:
2013-08-08 03:06:19 EDT
Size:
2.61 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..2fbae53 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,37 @@ > 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", >+ "interface I {\n" + >+ " String sam();\n" + >+ "}\n" + >+ "public class X {\n" + >+ " static String foo(I i) { return \"\"; }\n" + >+ " public static void main(String[] args) {\n" + >+ " foo(() -> foo(X::getInt));\n" + >+ " }\n" + >+ " static Integer getInt() { return 0; }\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 7)\n" + >+ " foo(() -> foo(X::getInt));\n" + >+ " ^^^^^^^^^\n" + >+ "The type of getInt() from the type X is Integer, this is incompatible with the descriptor's return type: String\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
Flags:
anchakrk
:
review?
Actions:
View
|
Diff
Attachments on
bug 412650
:
233548
|
233550
|
234130
| 234181