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] [Commented] (GROOVY-8254) Alias is ignored in constructor call
Date Thu, 13 Jul 2017 10:20:00 GMT

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

Daniil Ovchinnikov commented on GROOVY-8254:
--------------------------------------------

If Bar is defined in another file in the same package then alias is used in both cases. I.e.
alias takes precedence over classes in the same package. 

> Alias is ignored in constructor call
> ------------------------------------
>
>                 Key: GROOVY-8254
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8254
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.12
>            Reporter: Daniil Ovchinnikov
>
> {code:title=foo/Foo.groovy}
> package foo
> class Foo {}
> {code}
> {code:title=test/test.groovy}
> package test
> import foo.Foo as Bar
> class Bar {}
> def regular = new Bar()
> def anonymous = new Bar() {}
> println regular.class // class test.Bar
> println anonymous.class.superclass // class foo.Foo
> {code}
> Either both of the invocations should use alias or both of them should use class defined
in the same file. 



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

Mime
View raw message