This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 140911 - False Java generics related error reported
Summary: False Java generics related error reported
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Rastislav Komara
URL:
Keywords:
Depends on:
Blocks: 121950
  Show dependency tree
 
Reported: 2008-07-20 17:05 UTC by baga
Modified: 2009-05-06 15:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The problematic source (100 bytes, text/plain)
2008-07-20 17:06 UTC, baga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description baga 2008-07-20 17:05:38 UTC
The following code shows error in the IDE, while it compiles fine with javac:
public class ShowsCompileProblem<T extends java.util.List<? extends T> & java.util.RandomAccess> {
}
The reported error has the following message:
Error	types java.util.List<? extends T> and java.util.List<? extends T> are incompatible; both define iterator(), but
with unrelated return types	ShowsCompileProblem.java	1
Comment 1 baga 2008-07-20 17:06:36 UTC
Created attachment 65066 [details]
The problematic source
Comment 2 baga 2008-07-28 18:03:43 UTC
A simpler test file (the problem is independent from the order of the classes after extends):
public class ShowsCompileProblem<T extends java.util.List<?> & java.io.Serializable> {
}
Comment 3 baga 2008-08-02 10:32:05 UTC
This is also reproducible with the latest nightly. (200808010201)
Comment 4 baga 2008-10-20 20:08:12 UTC
Still reproducible with the latest nightly (200810181401):
File:
public class Issue140911<T extends java.util.List<?> & java.io.Serializable> {

}

Error report:
Error	types java.util.List<?> and java.util.List<?> are incompatible; both define iterator(), but with unrelated
return types	Issue140911.java	1

(I am not sure whether this is a compiler bug, or it has only representational problem. I leave this in the javac modul.
If you think this is a wrong place, please move this somewhere else place. Thanks.)
Comment 5 Jiri Prox 2008-10-21 12:01:47 UTC
The problem is & in generics, 

the compilation should be fine, there is only problem with incorrect error mark
Comment 6 Rastislav Komara 2009-02-03 10:57:47 UTC
Overtake.
Comment 7 Rastislav Komara 2009-05-06 15:10:51 UTC
This works form me in latest (dev) build.