Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.0-beta-3
-
Fix Version/s: 2.0.4, 2.1.0-beta-1, 1.8.9
-
Component/s: Stub generator / Joint compiler
-
Labels:None
-
Environment:2.0.0-beta-3-SNAPSHOT, JDK 1.7
-
Number of attachments :
Description
The following class definition fails to compile the Java stubs:
class GenericReturn {
public <T extends List> T foo() {
null
}
}
Error:
tmp/groovy-java-stubs/GenericReturn.java:16: error: incompatible types
public <T extends java.util.List> T foo() { return (java.util.List)null;}
^
required: T
found: List
where T is a type-variable:
T extends List declared in method <T>foo()
It compiles with no errors on 2.0-beta-2 and 1.8.6
Activity
Guillaume Laforge
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Priority | Major [ 3 ] | Blocker [ 1 ] |
| Component/s | Stub generator / Joint compiler [ 14523 ] | |
| Component/s | Compiler [ 13529 ] |
Guillaume Laforge
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | Guillaume Laforge [ guillaume ] | |
| Fix Version/s | 1.8.9 [ 18778 ] | |
| Fix Version/s | 2.0.3 [ 18777 ] | |
| Fix Version/s | 2.1.0 [ 18598 ] | |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
I am also getting this error on 1.8.7.
This code:
class Schedule<T extends ScheduleItem> extends HashSet<T> { (...) T getCurrentItem() { (...) } }Gives the error:
The offending line in the stub:
public T getCurrentItem() { return (nz.ac.auckland.digitizer.scheduler.ScheduleItem)null;}Doing a clean and rebuild in 1.8.6 with the same sources works fine.