groovy-notifications mailing list archives

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

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

ASF GitHub Bot commented on GROOVY-7925:
----------------------------------------

Github user paulk-asert closed the pull request at:

    https://github.com/apache/groovy/pull/411


> '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
>
> 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