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 2021/04/06 18:54:00 UTC
[jira] [Assigned] (GROOVY-10006) @CompileStatic fails to unify
types
[ https://issues.apache.org/jira/browse/GROOVY-10006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-10006:
------------------------------------
Assignee: Eric Milles
> @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
>
> {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.3.4#803005)