Summary: | [1.5][compiler] suspicious compiler errors on mix of for each and generics | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | jho |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.2 M2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
jho
2005-08-13 13:15:11 EDT
It indeed looks surprising, now javac agrees with us. Got it, problem comes from the fact Set1 is a raw type, where Set2 isn't. When Set1 (raw) is used, its supertype is also erased. Thus the supertype of raw Set1 is raw Iterable as opposed to Iterable<N>; hence it is inheriting #iterator() which returns an instance of raw Iterator. Instead of using Set1, use Set1<Node> instead. Added GenericTypeTest#test809 |