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 2021/10/24 00:15:00 UTC
[jira] [Resolved] (GROOVY-10308) SC incorrectly reports "access to
Object#field" is forbidden
[ https://issues.apache.org/jira/browse/GROOVY-10308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-10308.
----------------------------------
Fix Version/s: 4.0.0-beta-2
Resolution: Fixed
https://github.com/apache/groovy/commit/72c791402fef8181b218aad74b379dc3272829c7
> SC incorrectly reports "access to Object#field" is forbidden
> ------------------------------------------------------------
>
> Key: GROOVY-10308
> URL: https://issues.apache.org/jira/browse/GROOVY-10308
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Reporter: Thodoris Sotiropoulos
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-beta-2
>
>
> I have the following program:
> {code:groovy}
> class A<T> {
> T p
> }
> @groovy.transform.CompileStatic
> void test() {
> def x = { -> new A<String>() }
> def y = x()
> def z = y.p
> y = null // changes inferred type
> }
> test()
> {code}
> h3. Actual behaviour
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> test.groovy: 9: Access to java.lang.Object#f is forbidden @ line 8, column 13.
> def z = y.p
> ^
> 1 error
> {code}
> h3. Expected behaviour
> Compile successfully
> Tested against master
--
This message was sent by Atlassian Jira
(v8.3.4#803005)