View | Details | Raw Unified | Return to bug 209149
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+20 lines)
Lines 43550-43553 Link Here
43550
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" + 
43550
			"Class is a raw type. References to generic type Class<T> should be parameterized\n" + 
43551
			"----------\n");
43551
			"----------\n");
43552
}
43552
}
43553
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=209149
43554
public void test1311() {
43555
	String[] test = new String[] {
43556
		"X.java",
43557
		"class MyClass1<E, D extends E> {}\n" + 
43558
		"class MyClass2<E extends D, D> {}"
43559
	};
43560
	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
43561
		this.runNegativeTest(
43562
			test,
43563
			"----------\n" + 
43564
			"1. ERROR in X.java (at line 2)\n" + 
43565
			"	class MyClass2<E extends D, D> {}\n" + 
43566
			"	               ^\n" + 
43567
			"Illegal forward reference to type parameter D\n" + 
43568
			"----------\n");
43569
	} else {
43570
		this.runConformTest(test, "");
43571
	}
43572
}
43553
}
43573
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-3 / +5 lines)
Lines 482-490 Link Here
482
							isFirstBoundTypeVariable = true;
482
							isFirstBoundTypeVariable = true;
483
							TypeVariableBinding varSuperType = (TypeVariableBinding) superType;
483
							TypeVariableBinding varSuperType = (TypeVariableBinding) superType;
484
							if (varSuperType.rank >= typeVariable.rank && varSuperType.declaringElement == typeVariable.declaringElement) {
484
							if (varSuperType.rank >= typeVariable.rank && varSuperType.declaringElement == typeVariable.declaringElement) {
485
								problemReporter().forwardTypeVariableReference(typeParameter, varSuperType);
485
								if (compilerOptions().complianceLevel <= ClassFileConstants.JDK1_6) {
486
								typeVariable.tagBits |= TagBits.HierarchyHasProblems;
486
									problemReporter().forwardTypeVariableReference(typeParameter, varSuperType);
487
								break firstBound; // do not keep first bound
487
									typeVariable.tagBits |= TagBits.HierarchyHasProblems;
488
									break firstBound; // do not keep first bound
489
								}
488
							}
490
							}
489
							break;
491
							break;
490
						default :
492
						default :

Return to bug 209149