Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0-beta-3
-
Fix Version/s: 2.0-beta-3
-
Component/s: Static Type Checker
-
Labels:None
-
Environment:java 7, groovy 2.0-beta-3-snapshot
-
Number of attachments :
Description
ClassA.java
public class ClassA<T> { <X> Class<X> foo(Class<X> classType){ return classType; } }
ClassB.groovy
import groovy.transform.CompileStatic @CompileStatic class ClassB { void bar() { def ClassA<Long> a = new ClassA<Long>(); a.foo(this.getClass()); } }
ClassB.groovy: 13: [Static type checking] - Cannot find matching method ClassA#foo(java.lang.Class <java.lang.Object extends java.lang.Object>)
@ line 13, column 9.
a.foo(this.getClass());
^
Fixed by https://github.com/groovy/groovy-core/commit/57f81009f037eb3c50376da760f4ee43662f6ef4