[
https://issues.apache.org/jira/browse/GROOVY-12600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135657#comment-18135657
]
ASF GitHub Bot commented on GROOVY-12600:
-----------------------------------------
testlens-app[bot] commented on PR #3127:
URL: https://github.com/apache/groovy/pull/3127#issuecomment-6540199887
## 🚨 All tests passed but jobs failed 🚨
### Failed Jobs without Test Failures
❌ [Build and test for coverage /
test](https://github.com/apache/groovy/actions/runs/41176245352/job/124464292131?pr=3127)
🏷️ Commit: f15fe4969397baeb4f28762bfd6c92e6a1e55ed4
▶️ Tests: 45414 executed
🟡 Checks: 9/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/)._
> SC: a private field of the outer class referenced by its bare name in a class
> nested in a static nested subclass throws VerifyError
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12600
> URL: https://issues.apache.org/jira/browse/GROOVY-12600
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> class Base {
> private String z = 'x'
> @groovy.transform.CompileStatic
> static class Sub extends Base {
> def m() { z }
> }
> }
> assert new Base.Sub().m() == 'x'
> {code}
> Actual: the class fails verification when loaded:
> {noformat}
> java.lang.VerifyError: Bad type on operand stack
> Location: Base$Sub.m()Ljava/lang/Object; @1: invokevirtual
> Reason: Type 'Base$Sub' (current frame, stack[0]) is not assignable to
> 'groovy/lang/Closure'
> {noformat}
> The same happens for assignment, compound assignment and increment of the
> bare name, inside closures and lambdas, in an anonymous class within the
> subclass, and for a non-static inner subclass of a static nested class.
> Expected: {{m()}} returns 'x', the field the subclass inherits, as {{this.z}}
> and {{super.z}} already do under static compilation.
> Cause: the type checker resolves the name to the inherited field as a
> nestmate private access, but the static compilation transformer always
> rewrites it to {{Base.this.@z}}. The subclass has no enclosing Base instance,
> so the class generator falls back to the closure path and emits
> {{Closure.getThisObject()}} on a non-closure.
> Seen in 5.0.8 and 6.0.0. 4.0.33 compiles it to a dynamic access that throws
> MissingPropertyException.
> PR: https://github.com/apache/groovy/pull/3127
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)