Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.13, 4.0.6
-
None
Description
Consider the following:
@groovy.transform.CompileStatic void p() { java.util.function.Consumer c = this::print c.accept('hello world!') } p()
Throws error "LambdaConversionException: Type mismatch in captured lambda parameter 0: expecting class script, found class java.lang.Object"
I was trying to print a stream element via "this::println". This fails also with "System.out::println" as well. I had to use closure syntax which works just fine. Lambda throws NPE: "Consumer c = obj -> print(obj)"
Attachments
Attachments
Issue Links
- relates to
-
GROOVY-10858 STC method reference return type checking
- Closed
- links to