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 150825 Details for
Bug 293384
Eclipse erroneously reports method "is ambiguous for type"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Potential patch
patch.txt (text/plain), 3.14 KB, created by
Srikanth Sankaran
on 2009-10-29 10:47:26 EDT
(
hide
)
Description:
Potential patch
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2009-10-29 10:47:26 EDT
Size:
3.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v >retrieving revision 1.807 >diff -u -r1.807 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 15 Oct 2009 18:57:45 -0000 1.807 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 29 Oct 2009 14:47:20 -0000 >@@ -47,6 +47,33 @@ > compilerOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); > return compilerOptions; > } >+ >+ public void test0000() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X<Tout extends Object> {\n" + >+ " static public abstract class BaseA {};\n" + >+ " static public abstract class BaseB extends BaseA {};\n" + >+ " static public class Real extends BaseB {};\n" + >+ " static BaseA ask(String prompt) {\n" + >+ " Real impl = new Real();\n" + >+ " return (BaseA) ask(prompt, impl);\n" + >+ " }\n" + >+ " static BaseA ask(String prompt, Real impl) {\n" + >+ " return null;\n" + >+ " }\n" + >+ " static <T extends BaseA> T ask(String prompt, T impl) {\n" + >+ " return null;\n" + >+ " }\n" + >+ " static public void main(String[] args) {\n" + >+ " System.out.println(\"SUCCESS\");\n" + >+ " }\n" + >+ "}\n" >+ }, >+ "SUCCESS"); >+ } >+ > > public void test0001() { > this.runConformTest( >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.363 >diff -u -r1.363 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 16 Oct 2009 19:44:10 -0000 1.363 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 29 Oct 2009 14:47:25 -0000 >@@ -1398,7 +1398,11 @@ > MethodBinding otherCandidate = candidates[j]; > if (otherCandidate == candidate > || (candidate.declaringClass == otherCandidate.declaringClass && candidate.areParametersEqual(otherCandidate))) { >- return new ProblemMethodBinding(candidates[i], candidates[i].selector, candidates[i].parameters, ProblemReasons.Ambiguous); >+ // if both candidates or neither candidates would have qualified for an exact match, >+ // on the grounds of having substituted parameters, report ambiguity >+ // see org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.getExactMethod(char[], TypeBinding[], CompilationUnitScope) >+ if (candidate.hasSubstitutedParameters() == otherCandidate.hasSubstitutedParameters()) >+ return new ProblemMethodBinding(candidates[i], candidates[i].selector, candidates[i].parameters, ProblemReasons.Ambiguous); > } > } > }
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 293384
:
150825
|
151069