Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 09F69200B8E for ; Mon, 12 Sep 2016 00:30:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 088CA160AD4; Sun, 11 Sep 2016 22:30:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 76E14160AC7 for ; Mon, 12 Sep 2016 00:30:21 +0200 (CEST) Received: (qmail 7277 invoked by uid 500); 11 Sep 2016 22:30:20 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 7268 invoked by uid 99); 11 Sep 2016 22:30:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Sep 2016 22:30:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 914A12C014D for ; Sun, 11 Sep 2016 22:30:20 +0000 (UTC) Date: Sun, 11 Sep 2016 22:30:20 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-7925) 'this' and 'super' as LHS of an assignment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 11 Sep 2016 22:30:22 -0000 [ 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)