| Summary: | Phantom compiler error when introducing a base class with generic type argument | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] AJDT | Reporter: | Stefan Ocke <stefan.ocke> | ||||
| Component: | Core | Assignee: | AJDT-inbox <AJDT-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | andrew.eisenberg, stefan.ocke | ||||
| Version: | 2.1.3 | ||||||
| Target Milestone: | 2.2.0 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Thanks for the bug report. I have reproduced and found the problem. When augmenting the types during a reconcile, we were not properly handling generics. I will create some tests and commit the fix. Hello Andrew, I just installed AJDT 2.2.0.e37x-20120427-1300 on a fresh Eclipse 3.7.2. But the phantom error is still there... Created attachment 215139 [details]
Sample Project
Please open Main.java to see the phantom error in the editor.
Hmmm....I'll have another look. Looks like I was testing for a variant of the project that you supplied. In this case, all the classes were in the same file. The previous commit covered that bug. I have made a new commit that addresses the original problem described in this bug report. Committed the following changes to the E37 and master branches: http://git.eclipse.org/c/ajdt/org.eclipse.ajdt.git/commit/?h=E37&id=9ef4ab32f09df7da0359fd8ccf576e204275c1c4 http://git.eclipse.org/c/ajdt/org.eclipse.ajdt.git/commit/?id=b960b872a61e0c6b28e5bd4e8d7c66c5ada3141d This will be available on the E42 and E37 branches once the CI server creates the build in a few hours. Please let me know if you get a chance to try this out. Works as expected, now. Thanks. |
Build Identifier: 20110615-0604 AspectJ Development Tools 2.1.3.e37x-20110628-1900 When an ITD introduces a base class B<T> for a class A, that has a type argument, and that base class implements an interface InterfaceB<T> with a type argument, there is a "phantom" compiler error when trying to assign an instance of A to a variable of type IntefaceB<T>. That is, the compiler error only appears in the AspectJ/Java editor window, but not in the list of problems. (the project compiles sucessfully). The error message says: "Type mismatch ..." Note: If I remove the type argument, the phantom error disappears. Reproducible: Always Steps to Reproduce: public interface InterfaceB<T> {} public class B<T> implements InterfaceB<T> {} public class A {} public aspect AspectForA { declare parents: A extends B<String>; } public class Main { void phantomError(){ InterfaceB<String> b = new A(); //Here, the phantom error occurs. } }