[
https://issues.apache.org/jira/browse/GROOVY-12570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140074#comment-18140074
]
ASF GitHub Bot commented on GROOVY-12570:
-----------------------------------------
testlens-app[bot] commented on PR #3099:
URL: https://github.com/apache/groovy/pull/3099#issuecomment-6701208460
## ✅ All tests passed ✅
🏷️ Commit: 9b0a3341143e42f1db55a83ce6c4ae29344b71f4
▶️ Tests: 127700 executed
⚪️ Checks: 27/27 completed
---
_Learn more about TestLens at
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
> super.m() cannot reach a package-private method of a superclass defined by
> another class loader
> -----------------------------------------------------------------------------------------------
>
> Key: GROOVY-12570
> URL: https://issues.apache.org/jira/browse/GROOVY-12570
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> def shell = new GroovyShell()
> shell.evaluate '''package p
> class M { @groovy.transform.PackageScope String pm() { 'M' } }
> true
> '''
> shell.evaluate '''package p
> class B extends M { // same package name as M, but another class loader
> String pm() { 'B>' + super.pm() }
> }
> new B().pm()
> ''' // MissingMethodException; expected 'B>M'
> {code}
> The JVM does not let {{B.pm()}} override a package-private method of another
> run-time package, so no {{super$}} method can call it, and the meta-class
> drops the method from the methods for super calls without keeping the
> superclass method. Expected: in dynamic and {{@TypeChecked}} code,
> {{super.pm()}} calls {{M.pm()}}, and no {{super$}} method is generated for
> such a method, as it could only fail with {{IllegalAccessError}}. Under
> {{@CompileStatic}} it is reported with
> {{CompilerConfiguration.RUNTIME_PACKAGE_CHECK}} (GROOVY-12568).
> PR: https://github.com/apache/groovy/pull/3099
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)