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

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

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

   ## 🚨 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 \(17, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41153851742/job/124396201781?pr=3089)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface\(\) | ❌ | 0% 🟢 |
   
   🏷️ Commit: 4833b039922db45affe8753644aced8e24092c80
   ▶️ Tests:  60124 executed
   🟡 Checks: 14/24 completed
   
   ### Test Failures
   
   <details><summary><strong>MethodReferenceTest > 
testMethodReferencesInStaticAndDefaultMethodsOfInterface()</strong> (:test in 
<a 
href="https://github.com/apache/groovy/actions/runs/41153851742/job/124396201781?pr=3089";>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\(\) <!

> 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