groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-7925) 'this' and 'super' as LHS of an assignment
Date Sun, 11 Sep 2016 22:31:20 GMT

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

Paul King resolved GROOVY-7925.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.4.8

Proposed PR merged

> 'this' and 'super' as LHS of an assignment
> ------------------------------------------
>
>                 Key: GROOVY-7925
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7925
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>            Assignee: Paul King
>             Fix For: 2.4.8
>
>
> The following code runs successfully.
> {code}
> class Foo {
>   static void main(String[] args) {
>     assert "${this.name} ${super.name}" == 'Foo java.lang.Object'
>     super = true
>     this = false
>     assert "${this.name} ${super.name}" == 'Foo java.lang.Object'
>   }
> }
> {code}
> The attempt to change these 'special' variables is ignored but there should be some kind
of error. I think it makes sense for this to be a compilation error and it should come late
in the compilation phases to allow DSLs to include 'this' or 'super' and transform them into
something sensible.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message