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 2018/09/15 03:08:00 UTC

[jira] [Resolved] (GROOVY-7362) Can't compile Java class extending Groovy abstract class with explicit GroovyObject interface

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

Paul King resolved GROOVY-7362.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.5.3
                   3.0.0-alpha-4

The given example seems to have been fixed by other issues - I imagine releated issues as per comments are covered by GROOVY-8495.

> Can't compile Java class extending Groovy abstract class with explicit GroovyObject interface
> ---------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-7362
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7362
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.0
>            Reporter: Peter Gromov
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> That's a more advanced version of GROOVY-3877
> Compile classes.groovy:
> {code}
> abstract class AbstractClass extends ConcreteClass implements GroovyObject {}
> class ConcreteClass {}
> {code}
> Then compile JavaClass.java:
> {code}
> public class JavaClass extends AbstractClass {}
> {code}
> You get:
> {quote}
> JavaClass.java:1: error: JavaClass is not abstract and does not override abstract method setMetaClass(MetaClass) in GroovyObject
> public class JavaClass extends AbstractClass {
>        ^
> 1 error
> {quote}
> That's likely because setMetaClass is added as a synthetic method in ConcreteClass and not overridden in AbstractClass.
> This also happens without explicit GroovyObject interface when using joint compilation (https://youtrack.jetbrains.com/issue/IDEA-137722#comment=27-952814). Before generating stubs, "implements GroovyObject" is added to Groovy classes, and if it so happens that AbstractClass is visited before ConcreteClass, then "implements GroovyObject" will be added to both Groovy classes, but the (synthetic) implementations somehow end up being only in ConcreteClass.



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