Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.7
-
None
-
None
Description
The project at https://github.com/jeffbrown/generictraits contains the following:
src/main/groovy/demo/TopTrait.groovy
package demo
trait TopTrait<T> {
T getSomething() {}
}
src/main/groovy/demo/MiddleTrait.groovy
package demo trait MiddleTrait<T> implements TopTrait<T> {}
src/main/groovy/demo/BottomTrait.groovy
package demo trait BottomTrait<T> implements MiddleTrait<T> {}
src/main/groovy/demo/Demo.groovy
package demo // if this class implements MiddleTrait instead // of BottomTrait, it will compile... class Demo implements BottomTrait<String> {}
$ ./gradlew clean cG :clean :compileJava UP-TO-DATE :compileGroovy startup failed: /Users/jeff/t/generictraits/src/main/groovy/demo/Demo.groovy: -1: The return type of java.lang.Object getSomething() in demo.Demo is incompatible with java.lang.String in demo.TopTrait . At [-1:-1] @ line -1, column -1. 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: 2.123 secs