You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/01/31 09:55:00 UTC

[jira] [Assigned] (GROOVY-7160) NoSuchMethodError for varargs when type parameter extends interface

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

Paul King reassigned GROOVY-7160:
---------------------------------

    Assignee: Paul King

> NoSuchMethodError for varargs when type parameter extends interface
> -------------------------------------------------------------------
>
>                 Key: GROOVY-7160
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7160
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.3.7, 2.4.0-beta-3
>            Reporter: Yu Kobayashi
>            Assignee: Paul King
>            Priority: Major
>
> Java code
> {code}
> public class Foo<T extends java.io.Serializable> {
>     public void bar(T... args) {}
> }
> {code}
> Groovy code
> {code}
> @groovy.transform.CompileStatic
> void test() {
>     new Foo<String>().bar("a")
> }
> test()
> {code}
> Error message
> {code}
> Caught: java.lang.NoSuchMethodError: Foo.bar([Ljava/lang/Object;)V
> java.lang.NoSuchMethodError: Foo.bar([Ljava/lang/Object;)V
>         at test.test(test.groovy:3)
>         at test.run(test.groovy:5)
> {code}
> This happens for these two conditions.
> 1. Foo is a separate class and is not an inner class of the Groovy code
> 2. T extends interface



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)