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

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java (+4 lines)
Lines 202-207 Link Here
202
202
203
		LocalTypeBinding localType = buildLocalType(enclosingType, null /* anonymous super type*/, enclosingType.fPackage);
203
		LocalTypeBinding localType = buildLocalType(enclosingType, null /* anonymous super type*/, enclosingType.fPackage);
204
		connectTypeHierarchy();
204
		connectTypeHierarchy();
205
		if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
206
			checkParameterizedTypeBounds();
207
			checkParameterizedSuperTypeCollisions();
208
		}
205
		buildFieldsAndMethods();
209
		buildFieldsAndMethods();
206
		localType.faultInTypesForFieldsAndMethods();
210
		localType.faultInTypesForFieldsAndMethods();
207
211
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+40 lines)
Lines 48399-48402 Link Here
48399
			"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + 
48399
			"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + 
48400
			"----------\n");
48400
			"----------\n");
48401
}
48401
}
48402
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258039
48403
public void test1431()  throws Exception {
48404
	this.runNegativeTest(
48405
		new String[] {
48406
			"X.java", //=================================
48407
			"public class X {\n" + 
48408
			"	void foo() {\n" + 
48409
			"		class M<T extends Number> {}\n" + 
48410
			"		class N extends M<String> {}\n" + 
48411
			"		class O implements I<String>, I<Number> {}\n" + 
48412
			"	}\n" + 
48413
			"	class MM<T extends Number> {}\n" + 
48414
			"	class NN extends MM<String> {}\n" + 
48415
			"	class OO implements I<String>, I<Number> {}\n" + 
48416
			"}\n" +
48417
			"interface I<T> {}"
48418
		},
48419
		"----------\n" + 
48420
		"1. ERROR in X.java (at line 4)\n" + 
48421
		"	class N extends M<String> {}\n" + 
48422
		"	                  ^^^^^^\n" + 
48423
		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type M<T>\n" + 
48424
		"----------\n" + 
48425
		"2. ERROR in X.java (at line 5)\n" + 
48426
		"	class O implements I<String>, I<Number> {}\n" + 
48427
		"	      ^\n" + 
48428
		"The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" + 
48429
		"----------\n" + 
48430
		"3. ERROR in X.java (at line 8)\n" + 
48431
		"	class NN extends MM<String> {}\n" + 
48432
		"	                    ^^^^^^\n" + 
48433
		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type X.MM<T>\n" + 
48434
		"----------\n" + 
48435
		"4. ERROR in X.java (at line 9)\n" + 
48436
		"	class OO implements I<String>, I<Number> {}\n" + 
48437
		"	      ^^\n" + 
48438
		"The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" + 
48439
		"----------\n"
48440
	);
48441
}
48402
}
48442
}

Return to bug 259633