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

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

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

   ## 🚨 TestLens detected 1 failed test 🚨
   
   ### Test Summary
   > [!TIP]
   > Inspect all details with the [TestLens 
CLI](https://testlens.app/docs/features/cli): `testlens pr 3089`
   
   #### [Build and test / lts \(21, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/44979426409/job/137076442978?pr=3089)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | TraitASTTransformationTest > <span 
title='testSuperTraitStaticAccessorAsPropertyInLambdaStaticallyCompiledByCustomizer()'>testSuperTraitStaticAccessorAsPropertyInLambdaStaticallyComp…</span>
 | ❌ | 0%&nbsp;🟢 |
   
   🏷️ Commit: 41eb183b9e2caf7129badc2a2dc11fb5ef8a7aef
   ▶️ Tests:  97987 executed
   🟡 Checks: 12/24 completed
   
   ### Test Failures
   
   <details><summary><strong>TraitASTTransformationTest > 
testSuperTraitStaticAccessorAsPropertyInLambdaStaticallyCompiledByCustomizer()</strong>
 (:test in <a 
href="https://github.com/apache/groovy/actions/runs/44979426409/job/137076442978?pr=3089";>Build
 and test / lts (21, ubuntu-latest)</a>)</summary>
   
   ```
   org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
failed:
   Script2.groovy: -1: Cannot use package-private class T$4 from class T: T$4 
is defined by another class loader, so the JVM refuses this access. Use 
@CompileDynamic to reach it through the meta-class @ line -1, column 1.
   Script2.groovy: -1: Cannot use package-private class T$4 from class T: T$4 
is defined by another class loader, so the JVM refuses this access. Use 
@CompileDynamic to reach it through the meta-class @ line -1, column 1.
   Script2.groovy: -1: Cannot use package-private class T$4 from class T: T$4 
is defined by another class loader, so the JVM refuses this access. Use 
@CompileDynamic to reach it through the meta-class @ line -1, column 1.
   3 errors
   
        at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:350)
        at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:1198)
        at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:818)
        at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:771)
        at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:466)
        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:401)
        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:690)
        at groovy.lang.GroovyShell.parse(GroovyShell.java:702)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:553)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:565)
        at 
org.codehaus.groovy.transform.traitx.TraitASTTransformationTest.testSuperTraitStaticAccessorAsPropertyInLambdaStaticallyCompiledByCustomizer(TraitASTTransformationTest.groovy:3091)
   ```
   
   </details>
   
   ### Rerun Controls
   > [!NOTE]
   > Checks are currently running using the configuration below.
   
   Select tests to mute in this pull request:
   
   🔲 TraitASTTransformationTest > 
testSuperTraitStaticAccessorAsPropertyInLambdaStaticallyCompiledByCustomizer\(\)
 <!

> Cannot provide method reference to a type parameter instantiated with a SAM 
> type
> --------------------------------------------------------------------------------
>
>                 Key: GROOVY-10979
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10979
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Priority: Minor
>
> I have the following program
> {code}
> import java.util.function.*;
> import java.util.stream.*;
> public class Test {
>     public static void test() {
>       Stream<Number> x = null;
>       BiFunction<Function<String, Integer>, Number, Function<String, 
> Integer>> y = null;
>       BinaryOperator<Function<String, Integer>> z = null;
>       x.<Function<String, Integer>>reduce(Test::m, y, z);  // fails
>       x.reduce(Test::m, y, z);   // fails
>       x.reduce((d) -> 1, y, z);   // works
>     }
>     public static Integer m(String x) { return 1; }
> }
> {code}
> h3. Actual behavior
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> test.groovy: 12: The argument is a method reference, but the parameter type 
> is not a functional interface
>  @ line 12, column 43.
>    ction<String, Integer>>reduce(Test::m, y
>                                  ^
> test.groovy: 13: The argument is a method reference, but the parameter type 
> is not a functional interface
>  @ line 13, column 16.
>          x.reduce(Test::m, y, z);   // fails
>                   ^
> 2 errors
> {code}
> h3. Expected behavior
> Compile successfully
> Tested against master (commit: 55c6edfd81a64ce759357a3976070c0811bff637)



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

Reply via email to