[
https://issues.apache.org/jira/browse/GROOVY-12514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135510#comment-18135510
]
ASF GitHub Bot commented on GROOVY-12514:
-----------------------------------------
testlens-app[bot] commented on PR #3049:
URL: https://github.com/apache/groovy/pull/3049#issuecomment-6536984294
## 🚨 TestLens detected 1 failed test 🚨
### Test Summary
> [!TIP]
> Inspect all details with the [TestLens
CLI](https://testlens.app/docs/features/cli): `testlens pr 3049`
#### [Build and test / lts \(17,
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41152079809/job/124390672924?pr=3049)
> :test
| Test | Runs | Flakiness |
|---|---|--:|
| MethodReferenceTest >
testMethodReferencesInStaticAndDefaultMethodsOfInterface\(\) | ❌ | 0% 🟢 |
🏷️ Commit: 7b7060ca52a4c355e1308225c461aaa5620001a3
▶️ Tests: 62204 executed
🟡 Checks: 9/24 completed
### Test Failures
<details><summary><strong>MethodReferenceTest >
testMethodReferencesInStaticAndDefaultMethodsOfInterface()</strong> (:test in
<a
href="https://github.com/apache/groovy/actions/runs/41152079809/job/124390672924?pr=3049">Build
and test / lts (17, ubuntu-latest)</a>)</summary>
```
java.lang.ClassFormatError: Method gstring$I$ctorRef$make$0$1 in class I has
illegal modifiers: 0x101A
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at groovy.lang.GroovyClassLoader.access$000(GroovyClassLoader.java:90)
at
groovy.lang.GroovyClassLoader$ClassCollector.createClass(GroovyClassLoader.java:1305)
at groovy.lang.GroovyClassLoader.collect(GroovyClassLoader.java:284)
at
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:440)
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.transform.stc.MethodReferenceTest.testMethodReferencesInStaticAndDefaultMethodsOfInterface(MethodReferenceTest.groovy:1613)
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 MethodReferenceTest >
testMethodReferencesInStaticAndDefaultMethodsOfInterface\(\) <!
> STC: qualified this or super naming the current nested class (N.this, N.super
> inside N) is rejected
> ---------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12514
> URL: https://issues.apache.org/jira/browse/GROOVY-12514
> Project: Groovy
> Issue Type: Bug
> Components: Compiler, Static Type Checker
> Affects Versions: 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {{N.this}} inside a nested class {{N}} is {{this}}, and {{N.super.m()}} is
> {{super.m()}}. The type checker rejects both:
> {code:groovy}
> class Base { String m() { 'base' } }
> @groovy.transform.CompileStatic
> class Box {
> static class N extends Base {
> String id = 'n'
> String m() { 'n' }
> String test() { N.this.id + ' ' + N.super.m() }
> }
> }
> new Box.N().test()
> {code}
> {code}
> [Static type checking] - No such property: this for Class or static property
> for class: Box$N
> [Static type checking] - No such property: super for Class or static property
> for class: Box$N
> {code}
> (plus the errors that follow from them for {{id}} and {{m()}}). Dynamic
> Groovy returns {{n base}}, and javac accepts the same code. The same errors
> are reported under {{@TypeChecked}}, for an inner (non-static) class {{N}},
> for {{N.this.pm()}} and {{N.this.id = 'w'}}, for {{N.super.p}}, and inside a
> closure or lambda in {{N}}. {{N.this}} inside an anonymous class created in
> {{N}} already works, because {{N}} is an outer class there. Seen in 5.0.8,
> 6.0.0 and master.
> In a top-level class, {{Top.this}} and {{Top.super}} are rejected in every
> mode ("The usage of 'Class.this' and 'Class.super' is only allowed in
> nested/inner classes."), as GROOVY-4321 decided and {{StaticThisTest}} pins,
> so they are not part of this issue.
> Expected: under {{@TypeChecked}} and {{@CompileStatic}}, {{N.this}} and
> {{N.super}} inside the nested class {{N}} mean {{this}} and {{super}}, as in
> dynamic Groovy, except in a static context, where they stay an error.
> PR: https://github.com/apache/groovy/pull/3049
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)