[
https://issues.apache.org/jira/browse/GROOVY-10006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10006:
---------------------------------
Fix Version/s: 3.0.13
> @CompileStatic fails to unify types
> -----------------------------------
>
> Key: GROOVY-10006
> URL: https://issues.apache.org/jira/browse/GROOVY-10006
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation, Static Type Checker
> Affects Versions: 3.0.6
> Reporter: Konstantin Nisht
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-alpha-3, 3.0.13
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> {code:groovy}
> @CompileStatic
> class A {
> static <U> void foo(U a, U b) {}
> static void main(String[] args) {
> foo(1, "")
> }
> }
> {code}
> The following code fails to compile with error
> {{Groovyc: [Static type checking] - Cannot call <U> A#foo(U, U) with
> arguments [int, java.lang.String]}}
> {{U}} should be inferred to LUB(Integer, String), hence the call should be
> successful.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)