Christopher Smith created GROOVY-11676:
------------------------------------------
Summary: Method reference using class name results in bogus error
message
Key: GROOVY-11676
URL: https://issues.apache.org/jira/browse/GROOVY-11676
Project: Groovy
Issue Type: Bug
Affects Versions: 4.0.26
Reporter: Christopher Smith
I am writing a processing pipeline using {{with}} as a map-step. Since {{with}}
still does not accept {{{}Function{}}}, I am using method references. I had a
functional pipeline like this:
{code:groovy}
gremlin.V() /* stuff */
.with(Queries.&whoamiTraversal)
.with(Queries.&processTraversal)
{code}
This worked correctly when the methods were static. However, I changed
{{processTraversal}} to be a non-static method, and I should have changed the
invocation to {{this.&processTraversal}}. Instead, the STC did not complain,
and I received a runtime error
{code}
groovy.lang.MissingMethodException: No signature of method:
org.codehaus.groovy.runtime.MethodClosure.processTraversal() is applicable for
argument types: ...
{code}
Instead of pointing at {{MethodClosure}}, the error message should indicate
where the actual problem is.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)