Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.8, 2.4.0-beta-4
-
None
-
None
Description
The attached app contains the following code:
src/demo/SomeTrait.groovy
package demo trait SomeTrait { private static String someString }
src/demo/SomeClass.groovy
package demo class SomeClass implements SomeTrait {}
test/demo/SomeTestClass.groovy
package demo class SomeTestClass implements SomeTrait {}
SomeClass.groovy will compile. SomeTestClass.groovy will not compile.
$ ./gradlew clean cTG :clean :compileJava UP-TO-DATE :compileGroovy :processResources UP-TO-DATE :classes :compileTestJava UP-TO-DATE :compileTestGroovy startup failed: /Users/jeff/t/statictraitproperty/test/demo/SomeTestClass.groovy: -1: Method 'demo_SomeTrait__someString$get' is already defined in class 'demo.SomeTestClass'. You cannot have both a static and a non static method with the same signature @ line -1, column -1. /Users/jeff/t/statictraitproperty/test/demo/SomeTestClass.groovy: -1: Method 'demo_SomeTrait__someString$set' is already defined in class 'demo.SomeTestClass'. You cannot have both a static and a non static method with the same signature @ line -1, column -1. 2 errors :compileTestGroovy FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileTestGroovy'. > 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: 3.841 secs
If I edit build.gradle and change Groovy 2.3.8 to 2.3.7 the code will compile.