[jira] [Resolved] (GROOVY-6938) Wrong error reported by @CompileStatic when overriding a method returning a parameterized value

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (GROOVY-6938) Wrong error reported by @CompileStatic when overriding a method returning a parameterized value

JIRA jira@apache.org

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

Daniel Sun resolved GROOVY-6938.
--------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 2.5.0-rc-3
                   3.0.0-alpha-3
                   2.6.0-alpha-4

It is fixed https://github.com/apache/groovy/commit/3dd14f618c4c3ce9588cacf535c48a0b7163c810

> Wrong error reported by @CompileStatic when overriding a method returning a parameterized value
> -----------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-6938
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6938
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.3.4
>            Reporter: Mauro Molinari
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.6.0-alpha-4, 3.0.0-alpha-3, 2.5.0-rc-3
>
>
> Consider the following Java class:
> {code:java}
> package l;
> public class LJava <T extends Number> {
>    public T doSomething() {
>   return null;
>    }
> }
> {code}
> and the following Groovy class:
> {code}
> package l
> import groovy.transform.CompileStatic;
> @CompileStatic
> class L extends LJava<Integer> {
> Integer doSomething() {
> super.doSomething()
> }
> }
> {code}
> Static compilation fails because Groovy thinks that {{doSomething()}} for {{LJava<Integer>}} returns {{Number}} instead of {{Integer}}.



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