False "cannot be applied to"

Hi,

the following line is marked as compiler error, but compiles fine:


clipboard.addLookupChangeListener( new LookupChangeListener() { public void lookupChange( LookupChangeEvent extends Object> evt ) { GraphEditor.this.addCookie( ( Class super Object> ) evt.getLookupClass(), evt.getNewValue() );//no error but marked by idea } } ); with the addCookie method signature looking like this; public void addCookie( @NotNull Class super T> aClass, @Nullable T cookie ){...} LookupChangeListener interface: void lookupChange( LookupChangeEvent extends T>]]> evt );



Any ideas how I can avoid this?


Thanks,

Johannes Schneider

3 comments
Comment actions Permalink

What version of IDEA are you using? There have been quite a few fixes made to generics in 6.0, and if you could reproduce this with latest EAP and post it to JIRA, I would definitely have a look at it.

0
Comment actions Permalink

Build 5350

Eugene Vigdorchik wrote:

What version of IDEA are you using? There have been quite a few fixes made to generics in 6.0, and if you could reproduce this with latest EAP and post it to JIRA, I would definitely have a look at it.

0
Comment actions Permalink

Wow! It has been such a long time since somebody posted a request on type system implementation, that I'm rather impatient about yours. But please include a self-contained example of the problem.

0

Please sign in to leave a comment.