Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.0
-
None
Description
That's a more advanced version of GROOVY-3877
Compile classes.groovy:
abstract class AbstractClass extends ConcreteClass implements GroovyObject {} class ConcreteClass {}
Then compile JavaClass.java:
public class JavaClass extends AbstractClass {}
You get:
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
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.
Attachments
Issue Links
- is caused by
-
GROOVY-8495 GroovyObject method implementations are marked with ACC_SYNTHETIC
- Closed