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

ASF GitHub Bot commented on GROOVY-12524:
-----------------------------------------

daniellansun commented on PR #3064:
URL: https://github.com/apache/groovy/pull/3064#issuecomment-6512629594

   Friendly ping: CI is green and this is ready for review. If there are no 
objections, I plan to merge it this weekend. Thanks!




> SC: a compound assignment to a property defined by extension methods fails 
> with "Access to ... is forbidden"
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12524
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12524
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Assignee: Daniel Sun
>            Priority: Major
>
> Under {{@CompileStatic}}, a compound assignment to a property whose accessors 
> are extension methods does not compile:
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
>     String test(File file) {
>         file.text += 'b' // Access to java.io.File#text is forbidden
>         file.text
>     }
> }
> {code}
> Reading {{file.text}} and assigning {{file.text = 'b'}} compile to direct 
> calls of the extension methods {{getText(File)}} and {{setText(File, 
> String)}}, and dynamic Groovy and {{@TypeChecked}} run the compound 
> assignment. The same error is reported for {{this.text += 'b'}} and {{text += 
> 'b'}} in a subclass of {{File}}. Seen in 4.0.33, 5.0.8, 6.0.0 and master.
> Expected: the compound assignment compiles to calls of the extension methods, 
> like the read and the plain assignment.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to