[ https://issues.apache.org/jira/browse/GROOVY-11483?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-11483. ---------------------------------- Fix Version/s: 5.0.0-alpha-11 Resolution: Fixed https://github.com/apache/groovy/commit/8c18826393255562c15522d071429b5f0d8076d4 > reference to outer class non-private static field before special ctor call > -------------------------------------------------------------------------- > > Key: GROOVY-11483 > URL: https://issues.apache.org/jira/browse/GROOVY-11483 > Project: Groovy > Issue Type: Bug > Components: Static compilation > Reporter: Eric Milles > Assignee: Eric Milles > Priority: Major > Fix For: 5.0.0-alpha-11 > > > Consider the following: > {code:groovy} > 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' > } > } > {code} > 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. -- This message was sent by Atlassian Jira (v8.20.10#820010)