[ 
https://issues.apache.org/jira/browse/GROOVY-8960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles reassigned GROOVY-8960:
-----------------------------------

    Assignee: Eric Milles

> Can not call a java parameterized type method from groovy with java enum. 
> Compile error
> ---------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8960
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8960
>             Project: Groovy
>          Issue Type: Bug
>          Components: GroovyScriptEngine
>    Affects Versions: 2.5.5
>            Reporter: Stuart Adamson
>            Assignee: Eric Milles
>            Priority: Major
>
> Java:
> {code: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,
>     }
> }{code}
> Groovy calling class:
> {code:java}
> import groovy.transform.CompileStatic
> import aJavaClass
> @CompileStatic
> class aCallingGroovyClass {
>     static void main(String[] args) {
>         aJavaClass.create(aJavaClass.aEnum.entry1)
>     }
> }{code}
> try compiling get:
> {code:java}
> Error:(10, 9) Groovyc: [Static type checking] - Cannot call <A extends 
> java.io.Serializable> aJavaClass#create(A) with arguments 
> [aJavaClass$aEnum]{code}
> Replace the method arg aJavaClass.aEnum.entry1 with non enum, say '1' no 
> quotes, code compiles and runs.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to