[
https://issues.apache.org/jira/browse/GROOVY-12610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140656#comment-18140656
]
ASF GitHub Bot commented on GROOVY-12610:
-----------------------------------------
testlens-app[bot] commented on PR #3137:
URL: https://github.com/apache/groovy/pull/3137#issuecomment-6720062767
## 🚨 Jobs failed without executing tests 🚨
### Failed Jobs without Test Failures
❌ [Check licenses / test
\(ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42469142249/job/128695568353?pr=3137)
❌ [Generate SNAPSHOT distributions /
dist](https://github.com/apache/groovy/actions/runs/42469142297/job/128695568487?pr=3137)
❌ [Lint gate /
lint](https://github.com/apache/groovy/actions/runs/42469142247/job/128695568407?pr=3137)
❌ [Performance check /
test](https://github.com/apache/groovy/actions/runs/42469142319/job/128695569257?pr=3137)
❌ [jmh /
summary](https://github.com/apache/groovy/actions/runs/42469142293/job/128695680211?pr=3137)
❌ [jmh / test \(bench,
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42469142293/job/128695568821?pr=3137)
❌ [jmh / test \(core-ag,
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42469142293/job/128695568826?pr=3137)
❌ [jmh / test \(core-hz,
\\\\.perf\\\\.[H-Z]\)](https://github.com/apache/groovy/actions/runs/42469142293/job/128695568585?pr=3137)
❌ [jmh / test \(grails-ad,
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42469142293/job/128695568847?pr=3137)
❌ [jmh / test \(grails-ez,
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42469142293/job/128695568733?pr=3137)
❌ [jmh-classic /
summary](https://github.com/apache/groovy/actions/runs/42469142273/job/128695683736?pr=3137)
❌ [jmh-classic / test \(bench,
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42469142273/job/128695568502?pr=3137)
❌ [jmh-classic / test \(core-ag,
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42469142273/job/128695568477?pr=3137)
❌ [jmh-classic / test \(core-hz,
\\\\.perf\\\\.[H-Z]\)](https://github.com/apache/groovy/actions/runs/42469142273/job/128695568325?pr=3137)
❌ [jmh-classic / test \(grails-ad,
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42469142273/job/128695568483?pr=3137)
❌ [jmh-classic / test \(grails-ez,
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42469142273/job/128695568462?pr=3137)
🏷️ Commit: f7e2e797508ddd1ffc1f3e70090a2c879b4d716f
▶️ Tests: 0 executed
🟡 Checks: 18/26 completed
### Rerun Controls
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
> STC accepts access to a private superclass field through a nested subclass
> under @TypeChecked, which fails at run time
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12610
> URL: https://issues.apache.org/jira/browse/GROOVY-12610
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 4.0.33, 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> class Base {
> private String z = 'x'
> @groovy.transform.TypeChecked
> static class Sub extends Base {
> def m() { this.z } // also: z, super.z, closures, lambdas, writes,
> that.z
> }
> }
> new Base.Sub().m()
> {code}
> Actual: the code compiles, then fails with MissingPropertyException: No such
> property: z for class: Base$Sub. Dynamic Groovy fails the same way.
> Expected: under @TypeChecked, a compile error "No such property: z for class:
> Base$Sub", as already reported when Base and Sub are both nested in another
> class. @CompileStatic keeps accepting the code, because it accesses the field
> directly from a nest-mate.
> Cause: the type checker uses the nest-mate accessibility rule of static
> compilation for @TypeChecked code too. Type-checked code is dispatched
> dynamically, and the metaclass of a subclass does not list a private field of
> its superclass.
> Seen in 4.0.33, 5.0.8 and 6.0.0.
> PR: https://github.com/apache/groovy/pull/3137
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)