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

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

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

   ## 🚨 TestLens detected 1 failed test 🚨
   
   ### Test Summary
   > [!TIP]
   > Inspect all details with the [TestLens 
CLI](https://testlens.app/docs/features/cli): `testlens pr 3045`
   
   #### [Build and test / lts \(21, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41151301259/job/124388208523?pr=3045)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface\(\) | ❌ | 0% 🟢 |
   
   🏷️ Commit: 7de76922e90d93b741b07a680e344e42ca122fa0
   ▶️ Tests:  70879 executed
   🟡 Checks: 14/25 completed
   
   ### Test Failures
   
   <details><summary><strong>MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface()</strong> (:test in 
<a 
href="https://github.com/apache/groovy/actions/runs/41151301259/job/124388208523?pr=3045";>Build
 and test / lts (21, 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:1027)
        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\(\) <!

> super.sm() and super.sp fail for static members of the superclass (dynamic 
> Groovy, and in a closure under SC)
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12519
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12519
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime, Static compilation
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> A static method or static property of the superclass reached through 
> {{super}} fails in dynamic Groovy:
> {code:groovy}
> class Base {
>     static String sm() { 'sm:base' }
>     static String sp = 'sp:base'
> }
> class Dyn extends Base {
>     static String sm() { 'sm:dyn' }
>     static String sp = 'sp:dyn'
>     String m() { super.sm() }
>     String p() { super.sp }
> }
> new Dyn().m() // MissingMethodException: No signature of method: sm for 
> class: Base
> new Dyn().p() // MissingPropertyException: No such property: sp for class: Dyn
> {code}
> The same happens inside a closure. javac accepts the equivalent Java and 
> returns {{sm:base}} and {{sp:base}}. Under {{@CompileStatic}} both work in 
> the class body and {{super.sp}} works in a closure, but {{super.sm()}} in a 
> closure fails with {{IncompatibleClassChangeError: Expecting non-static 
> method 'java.lang.String Base.sm()'}}, because the {{super$}} helper method 
> calls the static method with {{invokespecial}}.
> In dynamic Groovy the super call is resolved through the {{super$}} helper 
> methods of the class, which are not generated for static methods. Seen in 
> 4.0.33, 5.0.8 and master.
> Expected: {{super.sm()}} and {{super.sp}} call the superclass's static method 
> and read its static property, in every mode, in the class body and in 
> closures and lambdas.
> PR: https://github.com/apache/groovy/pull/3045



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

Reply via email to