[ 
https://issues.apache.org/jira/browse/GROOVY-8358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniil Ovchinnikov updated GROOVY-8358:
---------------------------------------
    Summary: Inner class resolution behaves differently depending on class 
order  (was: Inner class resolution fails)

> Inner 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
(v6.4.14#64029)

Reply via email to