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 2025/11/26 18:32:00 UTC
[jira] [Updated] (GROOVY-11764) super property resolution
[ https://issues.apache.org/jira/browse/GROOVY-11764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-11764:
---------------------------------
Fix Version/s: 4.0.30
> super property resolution
> -------------------------
>
> Key: GROOVY-11764
> URL: https://issues.apache.org/jira/browse/GROOVY-11764
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Minor
> Fix For: 5.0.3, 4.0.30
>
>
> Consider the following:
> {code:groovy}
> package p
> class A {
> public Number getValue() {
> 42
> }
> }
> class B extends A {
> @PackageScope String value = 'xx'
> }
> // not in package p:
> class C extends p.B {
> void test() {
> print(super.value)
> }
> }
> new C().test()
> {code}
> I was expecting this to print "42" since {{C}} does not have access to the package-private field {{value}} of {{B}}. However, the script throws an {{IllegalAccessError}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)