[
https://issues.apache.org/jira/browse/GROOVY-7925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15462861#comment-15462861
]
ASF GitHub Bot commented on GROOVY-7925:
----------------------------------------
GitHub user paulk-asert opened a pull request:
https://github.com/apache/groovy/pull/411
GROOVY-7925: 'this' and 'super' as LHS of an assignment
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/paulk-asert/groovy groovy7925
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/411.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #411
----
commit 521abe7a283708954c6e2fad16d860264c7f9f56
Author: paulk <[email protected]>
Date: 2016-09-04T12:35:54Z
GROOVY-7925: 'this' and 'super' as LHS of an assignment
----
> '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)