[
https://issues.apache.org/jira/browse/GROOVY-10974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17761069#comment-17761069
]
Eric Milles edited comment on GROOVY-10974 at 8/31/23 8:41 PM:
---------------------------------------------------------------
https://github.com/apache/groovy/commit/6dc5b63a0976037cf01fa2f3ffe637a467461576
https://github.com/apache/groovy/commit/1a939beef11e4ae1ccd54ddb0f6659d53b742a52
was (Author: emilles):
https://github.com/apache/groovy/commit/6dc5b63a0976037cf01fa2f3ffe637a467461576
> Fail to perform SAM conversion using method references
> ------------------------------------------------------
>
> Key: GROOVY-10974
> URL: https://issues.apache.org/jira/browse/GROOVY-10974
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Thodoris Sotiropoulos
> Assignee: Eric Milles
> Priority: Minor
> Fix For: 5.0.0-alpha-2
>
>
> I have the following program
> {code}
> import java.util.*;
> import java.util.stream.*;
> import java.util.function.*;
> class Main {
> static final void test(DoubleStream x, ObjDoubleConsumer<Boolean> y,
> BiConsumer<Boolean, Boolean> z) {
> Spliterator.OfDouble d = null;
> StreamSupport.doubleStream(d, x.collect(
> () -> true, y::accept, z::accept));
> }
> }
> {code}
> h3. Actual behavior
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed:
> Main.groovy: 10: [Static type checking] - Cannot find matching method
> java.util.stream.StreamSupport#doubleStream(java.util.Spliterator$OfDouble,
> U). Please check if the declared type is correct and if the method exists.
> @ line 10, column 9.
> StreamSupport.doubleStream(d, x.collect(
> ^
> 1 error
> {code}
> h3. Expected behavior
> Compile successfully
> Tested against master (commit: d3c914693486bf137ec0992ef0dc28b79cba2fae)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)