[jira] [Commented] (GROOVY-8358) Nested class resolution behaves differently depending on class order
[ https://issues.apache.org/jira/browse/GROOVY-8358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17127559#comment-17127559 ] Daniil Ovchinnikov commented on GROOVY-8358: [~richardHu] Tell me what is unclear, please. > Nested class resolution behaves differently depending on class order > > > Key: GROOVY-8358 > URL: https://issues.apache.org/jira/browse/GROOVY-8358 > Project: Groovy > Issue Type: Bug >Reporter: Daniil Ovchinnikov >Priority: Critical > > {code} > package bugs > class Outer implements OuterI { > static class Current extends CurrentParent { > static usage() { > new Target() > } > } > } > class CurrentParent implements CurrentParentI {} > interface CurrentParentI { > static class Target {} > } > interface OuterI { > static class Target {} > } > println Outer.Current.usage() // bugs.OuterI$Target@3eb7fc54 > {code} > If {{CurrentParent}} definition is moved before {{Outer}}, then {{new > Target}} will be resolved to {{bugs.CurrentParentI$Target}}: > {code} > package bugs > class CurrentParent implements CurrentParentI {} > class Outer implements OuterI { > class Current extends CurrentParent { > static usage() { > new Target() > } > } > } > interface CurrentParentI { > static class Target {} > } > interface OuterI { > static class Target {} > } > println Outer.Current.usage() // bugs.CurrentParentI$Target@3eb7fc54 > {code} > Moving classes must not affect results of compilation. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (GROOVY-8358) Nested class resolution behaves differently depending on class order
[ https://issues.apache.org/jira/browse/GROOVY-8358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17127389#comment-17127389 ] richard1230 commented on GROOVY-8358: - this issue is not clearly described > Nested class resolution behaves differently depending on class order > > > Key: GROOVY-8358 > URL: https://issues.apache.org/jira/browse/GROOVY-8358 > Project: Groovy > Issue Type: Bug >Reporter: Daniil Ovchinnikov >Priority: Critical > > {code} > package bugs > class Outer implements OuterI { > static class Current extends CurrentParent { > static usage() { > new Target() > } > } > } > class CurrentParent implements CurrentParentI {} > interface CurrentParentI { > static class Target {} > } > interface OuterI { > static class Target {} > } > println Outer.Current.usage() // bugs.OuterI$Target@3eb7fc54 > {code} > If {{CurrentParent}} definition is moved before {{Outer}}, then {{new > Target}} will be resolved to {{bugs.CurrentParentI$Target}}: > {code} > package bugs > class CurrentParent implements CurrentParentI {} > class Outer implements OuterI { > class Current extends CurrentParent { > static usage() { > new Target() > } > } > } > interface CurrentParentI { > static class Target {} > } > interface OuterI { > static class Target {} > } > println Outer.Current.usage() // bugs.CurrentParentI$Target@3eb7fc54 > {code} > Moving classes must not affect results of compilation. -- This message was sent by Atlassian Jira (v8.3.4#803005)