Summary: | [5.0] Invalid capture-related compiler problem when generating delegate | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Tobias Widmer <tobias_widmer> | ||||
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||
Status: | RESOLVED WORKSFORME | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 3.1 | ||||||
Target Milestone: | 3.1 RC3 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Tobias Widmer
2005-05-18 11:01:56 EDT
Created attachment 21337 [details]
workspace preferences
I also encountered a similar error when moving up from 3.1M6 to 3.1RC2. I have several source files that no longer compile. Here is a simple test case that demonstrates the problem: import java.util.ArrayList; import java.util.List; public class Test { void foo() { List<? extends Number> s = new ArrayList<Number>(); List<? extends Number> t = new ArrayList<Number>(); s.addAll(t); // <-- Generates bogus error message } } javac agrees with us on latter case: Test.java:7: cannot find symbol symbol : method addAll(java.util.List<capture of ? extends java.lang.Number>) location: interface java.util.List<capture of ? extends java.lang.Number> s.addAll(t); // <-- Generates bogus error message ^ 1 error Basically, captures exhibits the fact that a wildcard denotes 'some' type, but not any type. See litterature on wildcards or JLS 3rd edition for more details. I cannot reproduce original issue with latest. Closing, pls reopen if you still see a problem. |