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-7185) Impossible to override method with generic array of Java class.
Date Wed, 01 Feb 2017 23:19:07 GMT

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

Paul King closed GROOVY-7185.
-----------------------------

> Impossible to override method with generic array of Java class.
> ---------------------------------------------------------------
>
>                 Key: GROOVY-7185
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7185
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.2.2, 2.3.8, 2.4.6
>         Environment: groovy 2.2.2 (tried with 2.3.8)
> java openjdk 1.7.0_65
> maven 3.2.2
> maven-compiler-plugin 3.1
> groovy-eclipse-compiler 2.8.0-01
> groovy-eclipse-batch 2.1.5-03
>            Reporter: Andrey Beletsky
>            Assignee: Shil Sinha
>              Labels: compiler, generics, java
>             Fix For: 2.4.8
>
>
> Java classes:
> {code}
> public interface A<T> {
>     T[] process();
> }
> public class B implements A<String> {
>     @Override
>     public String[] process() {
>         return new String[0];
>     }
> }
> {code}
> Groovy class:
> {code}
> class C extends B {
>     @Override
>     String[] process() {
>         return super.process()
>     }
> }
> {code}
> I've got following error during compilation:
> {noformat}
> Groovy:The return type of [Ljava.lang.String; process() in temp.C is incompatible with
[Ljava.lang.Object; process() in temp.B
> {noformat}
> BTW, I can't convert classes A and B to Groovy because it's library's classes (not mine).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message