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-7362) Can't compile Java class extending Groovy abstract class with explicit GroovyObject interface
Date Wed, 16 Jan 2019 12:09:02 GMT

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

Paul King closed GROOVY-7362.
-----------------------------

> 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
>
>
> 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)

Mime
View raw message