[
https://issues.apache.org/jira/browse/GROOVY-11612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-11612:
---------------------------------
Affects Version/s: 4.0.21
(was: 4.0.24)
> Groovy incorrectly compiles the accessing of InnerClass's variables when the
> OuterClass has a getter for it
> -----------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-11612
> URL: https://issues.apache.org/jira/browse/GROOVY-11612
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 4.0.21
> Reporter: Saravanan
> Assignee: Eric Milles
> Priority: Minor
>
> {code:java}
> @groovy.transform.CompileStatic
> class Outer {
> public String description
> public Outer(Inner inner) {
> // Groovy will compile this but the statement looks like this and
> will create a runtime error
> // String var3 = ((Outer)ScriptBytecodeAdapter.castToType(inner,
> Outer.class)).getDescription();
> this.description = inner.description;
> }
> public String getDescription() {
> return description
> }
> static Inner inner() {
> return new Inner()
> }
> static class Inner {
> public String description = "test"
> }
> }
> {code}
> Compiles successfully but the generated code fails at runtime
--
This message was sent by Atlassian Jira
(v8.20.10#820010)