You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2018/09/25 17:29:00 UTC

[jira] [Comment Edited] (GROOVY-8365) Static and static star imports allow non fully qualified names

    [ https://issues.apache.org/jira/browse/GROOVY-8365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16627682#comment-16627682 ] 

Eric Milles edited comment on GROOVY-8365 at 9/25/18 5:28 PM:
--------------------------------------------------------------

This is actually demonstrated in the language docs, although it is not discussed at length.  I found it a bit surprising that this is supported, but the checks within {{ResolveVisitor.visitClass}} do indeed implement it.

http://docs.groovy-lang.org/latest/html/documentation/#_static_import


was (Author: emilles):
This is actually demonstrated in the language docs, although it is not described.  I found it a bit surprising that this is supported, but the checks within {{ResolveVisitor.visitClass}} do indeed implement it.

http://docs.groovy-lang.org/latest/html/documentation/#_static_import

> 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
>            Priority: Major
>
> {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
(v7.6.3#76005)