groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniil Ovchinnikov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-8358) Inner class resolution fails
Date Thu, 19 Oct 2017 18:51:00 GMT
Daniil Ovchinnikov created GROOVY-8358:
------------------------------------------

             Summary: Inner class resolution fails
                 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 {

  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)

Mime
View raw message