Description
Take a simple abstract groovy class:
--- Foo.groovy abstract class Foo {} ---
compile it with groovyc. Take a simple java class
--- FooSub.java class FooSub extends Foo {} ---
try and compile it with javac. It will fail because the GroovyObject methods added to Foo are marked synthetic so it doesn't think GroovyObject has been implemented in the hierarchy. Neither javac or the Eclipse Compiler for Java (ECJ) allow synthetic methods to satisfy an interface implementation (and Foo has had GroovyObject added to it by groovyc). It is the word 'abstract' on Foo that causes both javac and ECJ to check this situation and report the problem.
I've discussed things with Jochen and we are thinking about removing synthetic for these methods if they are being added to a groovy type that is abstract.
Joint compilation works because the stubs don't show that the methods will be abstract when the java code is compiled.
Attachments
Attachments
Issue Links
- is duplicated by
-
GROOVY-3318 Javac doesn't see synthetic Groovy methods in Groovy-compiled superclass
- Closed
- is related to
-
GROOVY-8495 GroovyObject method implementations are marked with ACC_SYNTHETIC
- Closed