Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Consider the following:
class Outer { @groovy.transform.CompileStatic static class Inner { public final String value Inner(String string) { value = string } Inner() { this(VALUE.toString()) } } public static Integer VALUE = 42 static main(args) { assert new Inner().value == '42' } }
The expression "this(VALUE.toString())" throws a cast exception at runtime. It is compiled to this.getProperty("VALUE") – however "this" is static at the point.
Attachments
Issue Links
- is related to
-
GROOVY-6610 "Expecting to find object/array on stack" VerifyError when passing static member as argument to chained ctor call
- Closed