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] [Updated] (GROOVY-8365) Static and static star imports allow non fully qualified names
Date Tue, 24 Oct 2017 10:40:00 GMT

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

Daniil Ovchinnikov updated GROOVY-8365:
---------------------------------------
    Description: 
{code:title=bugs/classes.groovy}
package bugs

class ClassInTheSamePackage {
  static foo() { 42 }
  static class Inner {}
}
{code}

{code:title=bugs/test.groovy}
package bugs

import static ClassInTheSamePackage.*

println foo() // 42
println new Inner() // bugs.ClassInTheSamePackage$Inner@159f197
{code}

Expected: {{ClassInTheSamePackage}} should be unresolved, and consequently {{foo}} and {{Inner}}
will not resolve too 
  OR this "feature" should be documented.

  was:
{code:title=bugs/classes.groovy}
package bugs

class ClassInTheSamePackage {
  static foo() { 42 }
  static class Inner {}
}
{code}

{code:title=bugs/test.groovy}
package bugs

import static ClassInTheSamePackage.*

println foo() // 42
println new Inner() // bugs.ClassInTheSamePackage$Inner@159f197
{code}

Expected: {{ClassInTheSamePackage}} is unresolved, and consequently {{foo}} and {{Inner}}
are unresolved too.


> Static and static star imports allow non fully qualified names
> --------------------------------------------------------------
>
>                 Key: GROOVY-8365
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8365
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Daniil Ovchinnikov
>
> {code:title=bugs/classes.groovy}
> package bugs
> class ClassInTheSamePackage {
>   static foo() { 42 }
>   static class Inner {}
> }
> {code}
> {code:title=bugs/test.groovy}
> package bugs
> import static ClassInTheSamePackage.*
> println foo() // 42
> println new Inner() // bugs.ClassInTheSamePackage$Inner@159f197
> {code}
> Expected: {{ClassInTheSamePackage}} should be unresolved, and consequently {{foo}} and
{{Inner}} will not resolve too 
>   OR this "feature" should be documented.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message