[ 
https://issues.apache.org/jira/browse/GROOVY-12523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140659#comment-18140659
 ] 

ASF GitHub Bot commented on GROOVY-12523:
-----------------------------------------

testlens-app[bot] commented on PR #3050:
URL: https://github.com/apache/groovy/pull/3050#issuecomment-6720068632

   ## 🚨 Jobs failed without executing tests 🚨
   
   ### Failed Jobs without Test Failures
   
   ❌ [Check licenses / test 
\(ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42469143168/job/128695571458?pr=3050)
   ❌ [CodeQL / Analyze \(java, 
21\)](https://github.com/apache/groovy/actions/runs/42469143056/job/128695570920?pr=3050)
   ❌ [Generate SNAPSHOT distributions / 
dist](https://github.com/apache/groovy/actions/runs/42469142978/job/128695570686?pr=3050)
   ❌ [Lint gate / 
lint](https://github.com/apache/groovy/actions/runs/42469143045/job/128695571007?pr=3050)
   ❌ [Performance check / 
test](https://github.com/apache/groovy/actions/runs/42469143111/job/128695571291?pr=3050)
   ❌ [jmh / test \(bench, 
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42469143112/job/128695571555?pr=3050)
   ❌ [jmh / test \(core-ag, 
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42469143112/job/128695571612?pr=3050)
   ❌ [jmh / test \(grails-ad, 
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42469143112/job/128695571512?pr=3050)
   ❌ [jmh / test \(grails-ez, 
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42469143112/job/128695571318?pr=3050)
   ❌ [jmh-classic / test \(bench, 
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42469143052/job/128695571091?pr=3050)
   ❌ [jmh-classic / test \(core-hz, 
\\\\.perf\\\\.[H-Z]\)](https://github.com/apache/groovy/actions/runs/42469143052/job/128695571321?pr=3050)
   ❌ [jmh-classic / test \(grails-ad, 
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42469143052/job/128695571378?pr=3050)
   ❌ [jmh-classic / test \(grails-ez, 
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42469143052/job/128695571185?pr=3050)
   
   🏷️ Commit: 643561493d77d7c8fdc4bbb548e40ba504d8fc43
   ▶️ Tests:  0 executed
   🟡 Checks: 15/24 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: x.@name is accepted for a private field of a superclass when the type of 
> x is a subclass
> ---------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12523
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12523
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> In a class nested in {{Outer}}, the type checker accepts {{sub.@f}}, where 
> {{f}} is a private field of {{Outer}} and {{sub}} is typed as a subclass of 
> {{Outer}}:
> {code:groovy}
> @groovy.transform.TypeChecked
> class Outer {
>     private String f = 'outer'
>     static class Sub extends Outer {
>         String read(Sub sub) { sub.@f }
>     }
> }
> new Outer.Sub().read(new Outer.Sub()) // MissingFieldException: No such 
> field: f for class: Outer$Sub
> {code}
> Dynamic Groovy and {{@TypeChecked}} throw {{MissingFieldException}}, because 
> the meta-class of a subclass offers no private field of its superclass. 
> {{@CompileStatic}} reads the field. javac rejects {{sub.f}} ("f has private 
> access in Outer"), since a private field is not a member of a subclass (JLS 
> 8.2). With {{f}} declared in a nested class {{Box}} and {{Sub extends Box}}, 
> or with a top-level subclass, the type checker already rejects {{sub.@f}} 
> with "Cannot access field". Seen in 5.0.8, 6.0.0 and master; 4.0.33 failed at 
> run time in every mode.
> Expected: "Cannot access field: f of class: Outer", also for writes, 
> closures, lambdas and {{new Sub().@f}}. {{this.@f}}, {{super.@f}}, {{((Outer) 
> sub).@f}} and {{sub.@f}} inside {{Outer}} keep compiling.
> PR: https://github.com/apache/groovy/pull/3050



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to