You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2023/07/17 19:05:00 UTC

[jira] [Comment Edited] (GROOVY-5438) Private field inaccessible in closure when using a subclass

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

Eric Milles edited comment on GROOVY-5438 at 7/17/23 7:04 PM:
--------------------------------------------------------------

https://github.com/apache/groovy/commit/18ab1b75d98510cca97af10f3531ad122d469293
https://github.com/apache/groovy/commit/439517a6f7917722871bdf926d55e8cbf48f3871


was (Author: emilles):
https://github.com/apache/groovy/commit/18ab1b75d98510cca97af10f3531ad122d469293

> Private field inaccessible in closure when using a subclass
> -----------------------------------------------------------
>
>                 Key: GROOVY-5438
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5438
>             Project: Groovy
>          Issue Type: Sub-task
>          Components: groovy-jdk
>            Reporter: Mathieu Bruyen
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 5.0.0-alpha-1
>
>         Attachments: reproduce.groovy
>
>
> If a class defines a private field and a method that uses a closures referencing this private field, then a groovy.lang.MissingPropertyException is thrown any time this method is called from a subclass.
> It can be reproduced in the groovy console with the script in attachment. If "iterate" is called on the parent it works (text is appended to stdout - no exception), but if it is called from the subclass it fails (only the text from outside the closure is displayed and then an exception is thrown).
> This issue come from a deeper investigation on http://groovy.329449.n5.nabble.com/Exception-when-extending-ASTTransformationCustomizer-td5630073.html



--
This message was sent by Atlassian Jira
(v8.20.10#820010)