[ https://issues.apache.org/jira/browse/GROOVY-10228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-10228: --------------------------------- Fix Version/s: 3.0.20 > STC fails to substitute type variable in the presence of the diamond operator > and a function call > ------------------------------------------------------------------------------------------------- > > Key: GROOVY-10228 > URL: https://issues.apache.org/jira/browse/GROOVY-10228 > 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.20 > > > I think this bug is related to GROOVY-9963. > > I have the following program > {code:java} > class A<T> { > T x; A(T x) { > this.x = x; > } > T getX() { > return x; > } > } > class B {} > class Main { > public static void m1() { > def x = new B(); > m2(new A<>(x).getX()); > } public static void m2(B x) {} > } > {code} > h3. Actual behaviour > {code:java} > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > test.groovy: 18: [Static type checking] - Cannot find matching method > Main#m2(T). Please check if the declared type is correct and if the method > exists. > @ line 18, column 5. > m2(new A<>(x).getX()); > ^1 error > {code} > h3. Expected behaviour > Compile successfully > > Tested against master. > -- This message was sent by Atlassian Jira (v8.20.10#820010)