Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.5
-
None
Description
Java:
import java.io.Serializable; public class aJavaClass<A extends Serializable> { private aJavaClass(final A inA) { System.out.println("Hello"); } public static <A extends Serializable> aJavaClass<A> create(final A inA) { return new aJavaClass<>(inA); } public enum aEnum { entry1, } }
Groovy calling class:
import groovy.transform.CompileStatic import aJavaClass @CompileStatic class aCallingGroovyClass { static void main(String[] args) { aJavaClass.create(aJavaClass.aEnum.entry1) } }
try compiling get:
Error:(10, 9) Groovyc: [Static type checking] - Cannot call <A extends java.io.Serializable> aJavaClass#create(A) with arguments [aJavaClass$aEnum]
Replace the method arg aJavaClass.aEnum.entry1 with non enum, say '1' no quotes, code compiles and runs.