Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.0.13, 4.0.6
-
None
Description
Consider the following:
@groovy.transform.CompileStatic void test() { java.util.function.Function<Object,Number> f = Object::toString print(f.apply('xxx')) }
This code compiles and prints the string instead of a compile-time error indicating that String is not compatible with Number.
Attachments
Issue Links
- is related to
-
GROOVY-10813 Cannot create method reference for print or println
- Closed
-
GROOVY-10742 STC permits incorrect void method reference
- Closed