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());
^
Activity
Cedric Champeau
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Cedric Champeau [ melix ] |
Cedric Champeau
made changes -
| 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()); ^ |
{code:title=ClassA.java}
public class ClassA<T> { <X> Class<X> foo(Class<X> classType){ return classType; } } {code} {code:title=ClassB.groovy} import groovy.transform.CompileStatic @CompileStatic class ClassB { void bar() { def ClassA<Long> a = new ClassA<Long>(); a.foo(this.getClass()); } } {code} 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()); ^ |
Cedric Champeau
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
Cedric Champeau
made changes -
| Status | In Progress [ 3 ] | Resolved [ 5 ] |
| Fix Version/s | 2.0-beta-3 [ 18244 ] | |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Fixed by https://github.com/groovy/groovy-core/commit/57f81009f037eb3c50376da760f4ee43662f6ef4