Bug 108045

Summary: [compiler][1.5] unhelpful error message on bad generic inheritance
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Adam Kiezun CLA 2005-08-25 16:00:08 EDT
3.1
here's a case where eclipse generates 5 errors for 1 mistake and all are not
very helpful. When it happened to me I ran javac to understand what's going on.
They show 1 message and it tells you exactly what's wrong.

public class A<T0> extends ArrayList<T0> implements I<T0>{
}
interface I<T1> extends Collection{	
}

Eclipse error message (1 of 5):
Name clash: The method addAll(Collection<? extends E>) of type ArrayList<T0> has
the same erasure as addAll(Collection<? extends E>) of type Collection but does
not override it	

javac error message (1 of 1):
java.util.Collection cannot be inherited with different arguments: <> and <T0>
public class A<T0> extends ArrayList<T0> implements I<T0>{
^
Comment 1 Philipe Mulet CLA 2006-04-12 12:52:51 EDT
Works fine in latest, added GenericTypeTest#test0968