[
https://issues.apache.org/jira/browse/GROOVY-12525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18133693#comment-18133693
]
ASF GitHub Bot commented on GROOVY-12525:
-----------------------------------------
testlens-app[bot] commented on PR #3066:
URL: https://github.com/apache/groovy/pull/3066#issuecomment-6475473677
## 🚨 TestLens detected 2 failed tests 🚨
### Test Summary
> [!TIP]
> Inspect all details with the [TestLens
CLI](https://testlens.app/docs/features/cli): `testlens pr 3066`
#### [Build and test / lts \(17,
macos-latest\)](https://github.com/apache/groovy/actions/runs/40729377236/job/122961208232?pr=3066)
> :test
| Test | Runs | Flakiness |
|---|---|--:|
| BugsStaticCompileTest > <span
title='testExplicitGetterNameOnSuperIsVisibleWhenSubclassDeclaresTheOtherAccessor()'>testExplicitGetterNameOnSuperIsVisibleWhenSubclassDeclaresTh…</span>
| ❌ | 0% 🟢 |
| BugsStaticCompileTest > <span
title='testPackageFinalGetterInSamePackageBlocksGeneratedIsAccessor()'>testPackageFinalGetterInSamePackageBlocksGeneratedIsAccessor…</span>
| ❌ | 0% 🟢 |
🏷️ Commit: 85c7e74522028d6751dad0d5c55e0d1c7d739baa
▶️ Tests: 30325 executed
🟡 Checks: 1/20 completed
### Test Failures
<details><summary><strong>BugsStaticCompileTest >
testExplicitGetterNameOnSuperIsVisibleWhenSubclassDeclaresTheOtherAccessor()</strong>
(:test in <a
href="https://github.com/apache/groovy/actions/runs/40729377236/job/122961208232?pr=3066">Build
and test / lts (17, macos-latest)</a>)</summary>
```
java.lang.NoSuchMethodError: 'boolean Sub.isFlag()'
at
TestScript832b8540559743b08cbe8264dfea29f5.run(TestScript832b8540559743b08cbe8264dfea29f5.groovy:16)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:552)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
at
groovy.transform.stc.StaticTypeCheckingTestCase.assertScript(StaticTypeCheckingTestCase.groovy:78)
at
groovy.transform.stc.BugsSTCTest.testExplicitGetterNameOnSuperIsVisibleWhenSubclassDeclaresTheOtherAccessor(BugsSTCTest.groovy:1408)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
```
</details>
<details><summary><strong>BugsStaticCompileTest >
testPackageFinalGetterInSamePackageBlocksGeneratedIsAccessor()</strong> (:test
in <a
href="https://github.com/apache/groovy/actions/runs/40729377236/job/122961208232?pr=3066">Build
and test / lts (17, macos-latest)</a>)</summary>
```
java.lang.IllegalAccessError: class
org.codehaus.groovy.transform.stc.acc.TestScript5f90450f9ca448948216000c8763d055
tried to access method 'boolean
org.codehaus.groovy.transform.stc.acc.AccessorBases$PackageFinal.getFlag()'
(org.codehaus.groovy.transform.stc.acc.TestScript5f90450f9ca448948216000c8763d055
is in unnamed module of loader groovy.lang.GroovyClassLoader$InnerLoader
@3bee3935; org.codehaus.groovy.transform.stc.acc.AccessorBases$PackageFinal is
in unnamed module of loader 'app')
at
org.codehaus.groovy.transform.stc.acc.TestScript5f90450f9ca448948216000c8763d055.run(TestScript5f90450f9ca448948216000c8763d055.groovy:7)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:552)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:587)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:571)
at
groovy.transform.stc.StaticTypeCheckingTestCase.assertScript(StaticTypeCheckingTestCase.groovy:78)
at
groovy.transform.stc.BugsSTCTest.testPackageFinalGetterInSamePackageBlocksGeneratedIsAccessor(BugsSTCTest.groovy:1514)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 BugsStaticCompileTest >
testExplicitGetterNameOnSuperIsVisibleWhenSubclassDeclaresTheOtherAccessor\(\)
<!
> STC accepts a call to an isX() or getX() accessor that the property does not
> generate
> -------------------------------------------------------------------------------------
>
> Key: GROOVY-12525
> URL: https://issues.apache.org/jira/browse/GROOVY-12525
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 6.0.0
> Reporter: Scott Murphy Heiberg
> Assignee: Daniel Sun
> Priority: Major
>
> The type checker accepts a call to an accessor method that a property would
> generate, also when the property does not generate it, and the call then
> fails at run time in every mode:
> {code:groovy}
> @groovy.transform.TypeChecked
> class Box {
> boolean flag = true
> boolean getFlag() { flag } // with an explicit getFlag(), no isFlag() is
> generated
> }
> @groovy.transform.TypeChecked
> class C {
> boolean test(Box b) { b.isFlag() }
> }
> new C().test(new Box()) // MissingMethodException: No signature of method:
> isFlag for class: Box
> {code}
> Dynamic Groovy throws the same exception. Under {{@CompileStatic}} the call
> compiles to {{Box.isFlag()}} and fails with {{NoSuchMethodError: 'boolean
> Box.isFlag()'}}. The same happens for {{b.getFlag()}} when {{Box}} declares
> {{isFlag()}} instead, and for {{b.isFlag()}} on a {{Boolean flag}} property,
> which only gets {{getFlag()}}. Without an explicit accessor, a {{boolean}}
> property gets both, and the call works. Seen in 4.0.33, 5.0.8, 6.0.0 and
> master.
> Expected: "Cannot find matching method Box#isFlag()".
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)