Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: 2.7.2.Release
-
Component/s: Compiler Integration
-
Labels:None
-
Number of attachments :
Description
This is a distilled example of the problem:
import java.lang.ref.WeakReference import java.util.concurrent.ConcurrentHashMap @Typed class WeakValueMap<K2,V2> extends ConcurrentHashMap<K2,WeakValueMap.WV<V2>> {\n"+ static class WV<VV> extends WeakReference<VV> { } } @Typed class Foo { private final WeakValueMap<String,Class> cache public x(String name) { def res = cache.get(name).get() foo(res)\n"+ } public void foo(Class c) { } }
If you compile that and use the groovy++ ast transform (I was on 0.4.170) it will give you an error that it can't find the method foo(Object) - the type of res has been incorrectly inferred. It should be Class but the representation of generics that groovy-eclipse builds is slightly different to that built by plain groovyc, and this causes the inferencing breakdown.
possibly fixed with recent changes to generics handling but we aren't really testing with gpp any more.