You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2023/05/31 14:30:00 UTC

[jira] [Assigned] (GROOVY-11073) Cannot infer type of parameterized method when dealing with arrays

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

Eric Milles reassigned GROOVY-11073:
------------------------------------

    Assignee: Eric Milles

> Cannot infer type of parameterized method when dealing with arrays
> ------------------------------------------------------------------
>
>                 Key: GROOVY-11073
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11073
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Minor
>
> I have the following code
> {code}
> class Main {
>   static final void test() {
>     double[] x = Tuple.tuple(org.codehaus.groovy.runtime.ArrayGroovyMethods.max((double[][]) null, { -> 1 })).getV1();
>   }
> }
> {code}
> h3. Actual behavior
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> Main.groovy: 3: [Static type checking] - Cannot assign value of type (java.io.Serializable or java.lang.Cloneable) to variable of type double[]
>  @ line 3, column 18.
>        double[] x = Tuple.tuple(org.codehaus.groovy.runtime.ArrayGroovyMethods.max((double[][]) null, { -> 1 })).getV1();
>                     ^
> 1 error
> {code}
> h3. Expected behavior
> Compile successully
> Tested against master (commit: 73c0f12ab35427bc3e7fd76929b482df61e1b80d)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)