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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-5 lines)
Lines 2596-2606 Link Here
2596
				TypeBinding oneParam = oneParams[i];
2596
				TypeBinding oneParam = oneParams[i];
2597
				TypeBinding twoParam = twoParams[i];
2597
				TypeBinding twoParam = twoParams[i];
2598
				if (oneParam == twoParam) {
2598
				if (oneParam == twoParam) {
2599
					if (oneParam.leafComponentType().isRawType()) {
2600
						// A#RAW is not more specific than a rawified A<T>
2601
						if (oneParam == one.original().parameters[i] && oneParam != two.original().parameters[i])
2602
							return false;
2603
					}
2604
					continue;
2599
					continue;
2605
				}
2600
				}
2606
				if (oneParam.isCompatibleWith(twoParam)) {
2601
				if (oneParam.isCompatibleWith(twoParam)) {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+43 lines)
Lines 41119-41122 Link Here
41119
			false,
41119
			false,
41120
			null);		
41120
			null);		
41121
}
41121
}
41122
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
41123
public void test1232() {
41124
	this.runConformTest(
41125
		new String[] {
41126
			"X.java",
41127
			"public class X {\n" + 
41128
			"	public static void testCovariant(SubInterface sub1, SubInterface sub2) {\n" + 
41129
			"		SubInterface sub3 = sub1.and(sub2);\n" + 
41130
			"	}\n" + 
41131
			"	public interface SuperInterface<E> {\n" + 
41132
			"		public Number getNumber();\n" + 
41133
			"		public SuperInterface<E> and(SuperInterface<E> a);\n" + 
41134
			"	}\n" + 
41135
			"	public interface SubInterface extends SuperInterface {\n" + 
41136
			"		public Integer getNumber();\n" + 
41137
			"		public SubInterface and(SuperInterface s);\n" + 
41138
			"	}\n" + 
41139
			"}\n",
41140
		},
41141
		"");
41142
	
41143
}
41144
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
41145
public void test1233() {
41146
	this.runConformTest(
41147
		new String[] {
41148
			"X.java",
41149
			"public class X {\n" + 
41150
			"	public static void testCovariant(SubInterface<String> sub1, SubInterface<String> sub2) {\n" + 
41151
			"		SubInterface<String> sub3 = sub1.and(sub2);\n" + 
41152
			"	}\n" + 
41153
			"	public interface SuperInterface<E> {\n" + 
41154
			"		public Number getNumber();\n" + 
41155
			"		public SuperInterface<E> and(SuperInterface<E> a);\n" + 
41156
			"	}\n" + 
41157
			"	public interface SubInterface<F> extends SuperInterface<F> {\n" + 
41158
			"		public Integer getNumber();\n" + 
41159
			"		public SubInterface<F> and(SuperInterface<F> s);\n" + 
41160
			"	}\n" + 
41161
			"}\n",
41162
		},
41163
		"");
41164
}
41122
}
41165
}

Return to bug 215843