[jira] [Commented] (GROOVY-8474) 'Unexpected super property set for:' when accessing super class property via super.propertyName

2018-02-08 Thread Daniel Sun (JIRA)

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

Daniel Sun commented on GROOVY-8474:


[~blackdrag] I've refined the fix according to your suggestion :-)
https://github.com/apache/groovy/commit/221c13988cf904cb21a1c0559272a960918ad45d

> '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
>Assignee: Daniel Sun
>Priority: Critical
>
>  
> {{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)


[jira] [Commented] (GROOVY-8474) 'Unexpected super property set for:' when accessing super class property via super.propertyName

2018-02-08 Thread Jochen Theodorou (JIRA)

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

Jochen Theodorou commented on GROOVY-8474:
--

[~paulk] you are right, it only got moved

[~daniel_sun] thanks for the fix, but you may have changed semantics. If we 
prefer the getter for a super call, then why should we prefer the field in case 
of a setter? I was already in this area before with the bug I tried to fix 
around xmas, and noticed this for me strange behavior back then. I do prefer 
your way of course. But I do not think it aligns with what we have. So changing 
the order in your helper method would fix this and we really should define 
this better... and maybe redefine this for Groovy 3

> '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
>Assignee: Daniel Sun
>Priority: Critical
>
>  
> {{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)


[jira] [Commented] (GROOVY-8474) 'Unexpected super property set for:' when accessing super class property via super.propertyName

2018-02-08 Thread Daniel Sun (JIRA)

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

Daniel Sun commented on GROOVY-8474:


Fixed by: 
 
https://github.com/apache/groovy/commit/ca4ffaac1dfcaa8c38409a02b08392d0f8b2473f

> '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
>Assignee: Daniel Sun
>Priority: Critical
>
>  
> {{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)


[jira] [Commented] (GROOVY-8474) 'Unexpected super property set for:' when accessing super class property via super.propertyName

2018-02-08 Thread Paul King (JIRA)

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

Paul King commented on GROOVY-8474:
---

I don't think GROOVY-7924 is relevant here. That just moved the code in 
question inside the null check guard.

> '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
>Assignee: Daniel Sun
>Priority: Critical
>
>  
> {{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)


[jira] [Commented] (GROOVY-8474) 'Unexpected super property set for:' when accessing super class property via super.propertyName

2018-02-08 Thread Jochen Theodorou (JIRA)

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

Jochen Theodorou commented on GROOVY-8474:
--

git blame says this was added because of GROOVY-7924. If that is the case then 
this fix overshoots the target by miles. Not all super.foo constellations 
should be prevented. True, it cannot be compiled as method call to set... but 
frankly I question that logic as well

 

> '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
>Assignee: Daniel Sun
>Priority: Critical
>
>  
> {{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)


[jira] [Commented] (GROOVY-8474) 'Unexpected super property set for:' when accessing super class property via super.propertyName

2018-02-07 Thread Daniel Sun (JIRA)

[ 
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)