You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/02/03 22:33:00 UTC
[jira] [Closed] (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 ]
Paul King closed GROOVY-10308.
------------------------------
> 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.20.1#820001)