Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.7
-
None
Description
The attached traitinheritance.zip file contains the following code:
src/main/groovy/demo/DemoTrait.groovy
package demo trait DemoTrait { int getMagicNumber() { 42 } }
src/main/groovy/demo/DemoClass.groovy
package demo class DemoClass implements DemoTrait {}
All of that compiles as expected. If I add this class compilation fails:
src/main/groovy/demo/DemoSubClass.java
package demo; public class DemoSubClass extends DemoClass {}
Note that the compilation error message doesn't mention the newly created subclass. It mentions the class that previously compiled without error.
$ ./gradlew clean cG :clean :compileJava UP-TO-DATE :compileGroovy /Users/jeff/traitinheritance/build/tmp/groovy-java-stubs/demo/DemoClass.java:10: error: DemoClass is not abstract and does not override abstract method getMagicNumber() in DemoTrait public class DemoClass ^ 1 error startup failed: Compilation failed; see the compiler error output for details. 1 error :compileGroovy FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileGroovy'. > Compilation failed; see the compiler error output for details. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 4.378 secs