[jira] [Commented] (GROOVY-7849) Incompatible covariant array return type
[ https://issues.apache.org/jira/browse/GROOVY-7849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15315294#comment-15315294 ] ASF GitHub Bot commented on GROOVY-7849: Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/346 > Incompatible covariant array return type > > > Key: GROOVY-7849 > URL: https://issues.apache.org/jira/browse/GROOVY-7849 > Project: Groovy > Issue Type: Bug > Components: Compiler >Affects Versions: 2.4.6 >Reporter: Daniil Ovchinnikov > > Probably duplicates/is related to GROOVY-7185. > Consider the snippet: > {code} > interface Base {} > interface Derived extends Base {} > interface I { > Base[] foo() > } > interface I2 extends I { > Derived[] foo() > } > class C implements I2 { > Derived[] foo() { null } > } > {code} > Compilation fails with: > {noformat} > The return type of Derived[] foo() in C is incompatible with Base[] in I > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GROOVY-7849) Incompatible covariant array return type
[ https://issues.apache.org/jira/browse/GROOVY-7849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15313584#comment-15313584 ] ASF GitHub Bot commented on GROOVY-7849: GitHub user shils opened a pull request: https://github.com/apache/groovy/pull/346 GROOVY-7849: Verifier should be aware of array type covariance when c… …hecking overriding method return types You can merge this pull request into a Git repository by running: $ git pull https://github.com/shils/groovy GROOVY-7849 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/346.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #346 commit 861638e3ee7514fe391d1d4633e11f04caaa7445 Author: Shil SinhaDate: 2016-06-02T17:54:13Z GROOVY-7849: Verifier should be aware of array type covariance when checking overriding method return types > Incompatible covariant array return type > > > Key: GROOVY-7849 > URL: https://issues.apache.org/jira/browse/GROOVY-7849 > Project: Groovy > Issue Type: Bug > Components: Compiler >Affects Versions: 2.4.6 >Reporter: Daniil Ovchinnikov > > Probably duplicates/is related to GROOVY-7185. > Consider the snippet: > {code} > interface Base {} > interface Derived extends Base {} > interface I { > Base[] foo() > } > interface I2 extends I { > Derived[] foo() > } > class C implements I2 { > Derived[] foo() { null } > } > {code} > Compilation fails with: > {noformat} > The return type of Derived[] foo() in C is incompatible with Base[] in I > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GROOVY-7849) Incompatible covariant array return type
[ https://issues.apache.org/jira/browse/GROOVY-7849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15312418#comment-15312418 ] Shil Sinha commented on GROOVY-7849: The error occurs without I2 as well e.g. if C implements I instead of I2. > Incompatible covariant array return type > > > Key: GROOVY-7849 > URL: https://issues.apache.org/jira/browse/GROOVY-7849 > Project: Groovy > Issue Type: Bug > Components: Compiler >Affects Versions: 2.4.6 >Reporter: Daniil Ovchinnikov > > Probably duplicates/is related to GROOVY-7185. > Consider the snippet: > {code} > interface Base {} > interface Derived extends Base {} > interface I { > Base[] foo() > } > interface I2 extends I { > Derived[] foo() > } > class C implements I2 { > Derived[] foo() { null } > } > {code} > Compilation fails with: > {noformat} > The return type of Derived[] foo() in C is incompatible with Base[] in I > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)