When trying to use Clover on a Groovy class that is marked @CompileStatic and it contains a null-safe operator (e.g. Bar bar = foo?.bar), then the groovyc compilation fails with the error:
No such property: bar for class: java.lang.Object
The error is that the generated
$CLV_safeEval${code} method returns an Object instead of the type of the property. This then causes Groovy compiler to fail later. I've created a sample project that exhibits the problem at https://github.com/johnrengelman/clover-grooyv-compilestatic Simply run
./gradlew test
In case the problem still persists, may I ask you to:
1) Run the build with 'grails test-app -clover.on --verbose -Dclover.grover.ast.dump=true'. This will cause that Clover will dump AST (abstract syntax trees) to your java.io.tmpdir directory. You'll see messages in log like:
2) Attach *.before.clovered and *.after.clovered files for a single groovy class which does not compile due to the safeEval() problem?
3) Could you also remove the @CompileStatic annotation and run a build again (it should succeed) and attach the *.class file produced?
I'd like to analyze it.