Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
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)); } }
Actual behavior
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
Expected behavior
Compile successfully
Tested against master (commit: d3c914693486bf137ec0992ef0dc28b79cba2fae)
Attachments
Issue Links
- is related to
-
GROOVY-10975 STC rejects program when passing method reference in parameterized function
- Closed
- relates to
-
GROOVY-11259 STC loses generic information on method references
- Closed