[ https://issues.apache.org/jira/browse/GROOVY-9131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Sun updated GROOVY-9131: ------------------------------- Fix Version/s: 3.0.0-beta-2 > Extension method support for native method references > ----------------------------------------------------- > > Key: GROOVY-9131 > URL: https://issues.apache.org/jira/browse/GROOVY-9131 > Project: Groovy > Issue Type: Improvement > Reporter: Paul King > Assignee: Daniel Sun > Priority: Major > Fix For: 3.0.0-beta-2 > > > The following two method reference statements compile and execute > successfully with and without @CS (and with CS produce the correct native > bytecode): > {code} > assert 'Hi'.transform(String::length) == 2 // transform is JDK12 > assert 'Hi'.transform(StringGroovyMethods::size) == 2 > {code} > This statement (using the extension method from StringGroovyMethods) works > for dynamic Groovy: > {code} > assert 'Hi'.transform(String::size) == 2 > {code} > But for static Groovy fails compilation with: > {noformat} > 1 compilation error: > org.codehaus.groovy.syntax.RuntimeParserException: Failed to find the > expected method[size(java.lang.String)] in the type[java.lang.String] > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)