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

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

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

   ## 🚨 TestLens detected 10 failed tests 🚨
   
   ### Test Summary
   > [!TIP]
   > Inspect all details with the [TestLens 
CLI](https://testlens.app/docs/features/cli): `testlens pr 3050`
   
   #### [Build and test / lts \(17, 
macos-latest\)](https://github.com/apache/groovy/actions/runs/41660149696/job/126000895104?pr=3050)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | Groovy12533 > <span 
title='testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()'>testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName\(…</span>
 | ❌ | 0%&nbsp;🟢 |
   | Groovy12533 > <span 
title='testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()'>testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldB…</span>
 | ❌ | 0%&nbsp;🟢 |
   
   #### [Build and test / lts \(17, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41660149696/job/126000895868?pr=3050)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | Groovy12533 > <span 
title='testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()'>testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName\(…</span>
 | ❌ | 0%&nbsp;🟢 |
   | Groovy12533 > <span 
title='testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()'>testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldB…</span>
 | ❌ | 0%&nbsp;🟢 |
   
   #### [Build and test / lts \(17, windows-latest, 
1\)](https://github.com/apache/groovy/actions/runs/41660149696/job/126000895820?pr=3050)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | Groovy12533 > <span 
title='testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()'>testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName\(…</span>
 | ❌ | 0%&nbsp;🟢 |
   | Groovy12533 > <span 
title='testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()'>testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldB…</span>
 | ❌ | 0%&nbsp;🟢 |
   
   #### [Build and test / lts \(21, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41660149696/job/126000895747?pr=3050)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | Groovy12533 > <span 
title='testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()'>testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName\(…</span>
 | ❌ | 0%&nbsp;🟢 |
   | Groovy12533 > <span 
title='testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()'>testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldB…</span>
 | ❌ | 0%&nbsp;🟢 |
   
   #### [Build and test / lts \(25, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41660149696/job/126000895597?pr=3050)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | Groovy12533 > <span 
title='testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()'>testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName\(…</span>
 | ❌ | 0%&nbsp;🟢 |
   | Groovy12533 > <span 
title='testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()'>testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldB…</span>
 | ❌ | 0%&nbsp;🟢 |
   
   🏷️ Commit: 4a9431fe371dde63c5c0f4235eb18c996a5ed2e9
   ▶️ Tests:  49312 executed
   🟡 Checks: 7/24 completed
   
   ### Test Failures
   
   <details><summary><strong>Groovy12533 > 
testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()</strong> (:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895104?pr=3050";>Build
 and test / lts (17, macos-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 37.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 45.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                  ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 53.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 70.
      byName() { [this.f, f, { -> this.f }(), { -> f }()] }
                                                   ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 47.
                          def write(String value) { f = value; this.f }
                                                    ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 58.
                          def write(String value) { f = value; this.f }
                                                               ^
   
   6 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName(Groovy12533.groovy:141)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()</strong>
 (:test in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895104?pr=3050";>Build
 and test / lts (17, macos-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 41.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                              ^
   
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 57.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                                              ^
   
   2 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute(Groovy12533.groovy:119)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()</strong> (:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895868?pr=3050";>Build
 and test / lts (17, ubuntu-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 37.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 45.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                  ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 53.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 70.
      byName() { [this.f, f, { -> this.f }(), { -> f }()] }
                                                   ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 47.
                          def write(String value) { f = value; this.f }
                                                    ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 58.
                          def write(String value) { f = value; this.f }
                                                               ^
   
   6 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName(Groovy12533.groovy:141)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()</strong>
 (:test in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895868?pr=3050";>Build
 and test / lts (17, ubuntu-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 41.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                              ^
   
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 57.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                                              ^
   
   2 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute(Groovy12533.groovy:119)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()</strong> (:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895820?pr=3050";>Build
 and test / lts (17, windows-latest, 1)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 37.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 45.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                  ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 53.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 70.
      byName() { [this.f, f, { -> this.f }(), { -> f }()] }
                                                   ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 47.
                          def write(String value) { f = value; this.f }
                                                    ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 58.
                          def write(String value) { f = value; this.f }
                                                               ^
   
   6 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName(Groovy12533.groovy:141)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()</strong>
 (:test in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895820?pr=3050";>Build
 and test / lts (17, windows-latest, 1)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 41.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                              ^
   
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 57.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                                              ^
   
   2 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute(Groovy12533.groovy:119)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()</strong> (:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895747?pr=3050";>Build
 and test / lts (21, ubuntu-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 37.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 45.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                  ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 53.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 70.
      byName() { [this.f, f, { -> this.f }(), { -> f }()] }
                                                   ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 47.
                          def write(String value) { f = value; this.f }
                                                    ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 58.
                          def write(String value) { f = value; this.f }
                                                               ^
   
   6 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName(Groovy12533.groovy:141)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()</strong>
 (:test in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895747?pr=3050";>Build
 and test / lts (21, ubuntu-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 41.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                              ^
   
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 57.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                                              ^
   
   2 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute(Groovy12533.groovy:119)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName()</strong> (:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895597?pr=3050";>Build
 and test / lts (25, ubuntu-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 37.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 45.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                  ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 53.
                          def byName() { [this.f, f, { -> this.f }(), { -> f 
}()] }
                                                          ^
   
   TestScript55.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 70.
      byName() { [this.f, f, { -> this.f }(), { -> f }()] }
                                                   ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 47.
                          def write(String value) { f = value; this.f }
                                                    ^
   
   TestScript55.groovy: 7: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 7, column 58.
                          def write(String value) { f = value; this.f }
                                                               ^
   
   6 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName(Groovy12533.groovy:141)
   ```
   
   </details>
   <details><summary><strong>Groovy12533 > 
testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute()</strong>
 (:test in <a 
href="https://github.com/apache/groovy/actions/runs/41660149696/job/126000895597?pr=3050";>Build
 and test / lts (25, ubuntu-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 41.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                              ^
   
   TestScript59.groovy: 6: [Static type checking] - No such property: f for 
class: Outer$Sub
    @ line 6, column 57.
                              def byName() { [this.f, f, { -> this.f }(), { -> 
f }()] }
                                                              ^
   
   2 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1164)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:784)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:737)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:438)
        at 
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:378)
        at 
org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:143)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:378)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:664)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:551)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
        at 
bugs.Groovy12533.testInnerSubclassReadsEnclosingInstanceByNameAndItsOwnFieldByAttribute(Groovy12533.groovy:119)
   ```
   
   </details>
   
   ### Rerun Controls
   > [!NOTE]
   > Checks are currently running using the configuration below.
   
   Select tests to mute in this pull request:
   
   🔲 Groovy12533 > 
testCompileStaticStaticNestedSubclassReadsItsOwnFieldByName\(\) <!

> 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