Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.7, 2.4.1
-
None
Description
import groovy.transform.CompileStatic @CompileStatic class Test { static class Inner { private String baz void setBaz(String b) { this.baz = b } } static <T> T fun(T t) { return t } static void main(String[] args) { Test.fun({ 1 }).resolveStrategy = Closure.DELEGATE_FIRST ((Closure)Test.fun({ 1 })).resolveStrategy = Closure.DELEGATE_FIRST Test.fun(new Test.Inner()).baz = 'foo' Test.fun('String').contains('ing') } } Test.main()
With @CompileStatic this code produces the following error:
[Static type checking] - No such property: resolveStrategy for class: java.lang.Object
Without @CompileStatic the code runs without error.
Attachments
Issue Links
- is related to
-
GROOVY-7648 Problem with @CompileStatic, generic types, and varags
- Closed