You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2018/02/08 02:51:00 UTC
[jira] [Commented] (GROOVY-8474) 'Unexpected super property set
for:' when accessing super class property via super.propertyName
[ https://issues.apache.org/jira/browse/GROOVY-8474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16356416#comment-16356416 ]
Daniel Sun commented on GROOVY-8474:
------------------------------------
The following code will be forbidden by AsmClassGenerator...
{code:java}
super.xxx = yyy
{code}
{code:java}
if (isSuperExpression(objectExpression)) {
String prefix;
if (controller.getCompileStack().isLHS()) {
throw new GroovyBugError("Unexpected super property set for:" + expression.getText());
} else {
prefix = "get";
}
String propName = prefix + MetaClassHelper.capitalize(name);
visitMethodCallExpression(new MethodCallExpression(objectExpression, propName, MethodCallExpression.NO_ARGUMENTS));
return;
}
{code}
https://github.com/apache/groovy/blob/6f3d2fe7175b22cc4885aff5a8693fbc70478e33/src/main/java/org/codehaus/groovy/classgen/AsmClassGenerator.java#L1010-L1020
> 'Unexpected super property set for:' when accessing super class property via super.propertyName
> -----------------------------------------------------------------------------------------------
>
> Key: GROOVY-8474
> URL: https://issues.apache.org/jira/browse/GROOVY-8474
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.13
> Environment: Mac OS X, JDK 8
> Reporter: zhb
> Priority: Major
>
>
> {{class T {}}
> {{ String group}}
> {{}}}
> {{class S extends T {}}
> {{ S() {}}
> {{ super.group = ''}}
> }
> {{}}}
>
> BUG! exception in phase 'class generation' in source unit 'ideaGroovyConsole.groovy' Unexpected super property set for:super.group
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)