Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The following two method reference statements compile and execute successfully with and without @CS (and with CS produce the correct native bytecode):
assert 'Hi'.transform(String::length) == 2 // transform is JDK12 assert 'Hi'.transform(StringGroovyMethods::size) == 2
This statement (using the extension method from StringGroovyMethods) works for dynamic Groovy:
assert 'Hi'.transform(String::size) == 2
But for static Groovy fails compilation with:
1 compilation error: org.codehaus.groovy.syntax.RuntimeParserException: Failed to find the expected method[size(java.lang.String)] in the type[java.lang.String]
Attachments
Issue Links
- links to