View | Details | Raw Unified | Return to bug 293384 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+27 lines)
Lines 47-52 Link Here
47
		compilerOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED);
47
		compilerOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED);
48
		return compilerOptions;
48
		return compilerOptions;
49
	}
49
	}
50
	
51
	public void test0000() {
52
		this.runConformTest(
53
			new String[] {
54
				"X.java",
55
				"public class X<Tout extends Object> {\n" +
56
				"   static public abstract class BaseA {};\n" +
57
				"	static public abstract class BaseB extends BaseA {};\n" +
58
				"	static public class Real extends BaseB {};\n" +
59
				"	static BaseA ask(String prompt) {\n" +
60
				"	    Real impl = new Real();\n" +
61
				"	    return (BaseA) ask(prompt, impl);\n" +
62
				"	}\n" +
63
				"	static BaseA ask(String prompt, Real impl) {\n" +
64
				"	    return null;\n" +
65
				"	}\n" +
66
				"	static <T extends BaseA> T ask(String prompt, T impl) {\n" +
67
				"	    return null;\n" +
68
				"	}\n" +
69
				"	static public void main(String[] args) {\n" +
70
				"        System.out.println(\"SUCCESS\");\n" +
71
				"	}\n" +
72
				"}\n"
73
			},
74
			"SUCCESS");
75
	}
76
50
77
51
	public void test0001() {
78
	public void test0001() {
52
		this.runConformTest(
79
		this.runConformTest(
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-1 / +5 lines)
Lines 1398-1404 Link Here
1398
						MethodBinding otherCandidate = candidates[j];
1398
						MethodBinding otherCandidate = candidates[j];
1399
						if (otherCandidate == candidate
1399
						if (otherCandidate == candidate
1400
								|| (candidate.declaringClass == otherCandidate.declaringClass && candidate.areParametersEqual(otherCandidate))) {
1400
								|| (candidate.declaringClass == otherCandidate.declaringClass && candidate.areParametersEqual(otherCandidate))) {
1401
							return new ProblemMethodBinding(candidates[i], candidates[i].selector, candidates[i].parameters, ProblemReasons.Ambiguous);
1401
							// if both candidates or neither candidates would have qualified for an exact match,
1402
							// on the grounds of having substituted parameters, report ambiguity
1403
							// see org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.getExactMethod(char[], TypeBinding[], CompilationUnitScope)
1404
							if (candidate.hasSubstitutedParameters() == otherCandidate.hasSubstitutedParameters())
1405
								return new ProblemMethodBinding(candidates[i], candidates[i].selector, candidates[i].parameters, ProblemReasons.Ambiguous);
1402
						}
1406
						}
1403
					}
1407
					}
1404
			}
1408
			}

Return to bug 293384