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

Eric Milles updated GROOVY-10315:
---------------------------------
    Fix Version/s: 3.0.13

> Unable to infer type variable of parameterized function that expects two 
> parameters
> -----------------------------------------------------------------------------------
>
>                 Key: GROOVY-10315
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10315
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-beta-2, 3.0.13
>
>
> I have the following program
> {code:java}
> class A<T> {
>   void m(T x) {}
>   <T2> T m2() {
>     return null;
>   }
> }
> class Main {
>   <T> void m1() {
>     A<T> x = new A<T>();
>     m3(m2(), x.m2()); // does not work
>   }
>   <T> T m2() {
>     return null;
>   }
>   <T> void m3(T x, T y) {}
> }
> {code}
> h3. Actual behavior
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> test.groovy: 12: [Static type checking] - Cannot call <T> Main#m3(T, T) with 
> arguments [#T, T]
>  @ line 12, column 5.
>        m3(m2(), x.m2()); // does not work
>        ^
> 1 error
> {code}
> h3. Expected behaviour
> Compile successfully.
> Tested against master



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

Reply via email to