groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (GROOVY-7160) NoSuchMethodError for varargs when type parameter extends interface
Date Thu, 21 Feb 2019 06:19:02 GMT

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

Paul King closed GROOVY-7160.
-----------------------------

> 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
>             Fix For: 2.5.6, 3.0.0-alpha-5
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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)

Mime
View raw message