You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Dinko Srkoc (JIRA)" <ji...@apache.org> on 2015/06/29 10:32:04 UTC
[jira] [Commented] (GROOVY-7480) ClosureMetaClass wrong routing
calls logic
[ https://issues.apache.org/jira/browse/GROOVY-7480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14605281#comment-14605281 ]
Dinko Srkoc commented on GROOVY-7480:
-------------------------------------
Smaller example would be:
{code}
def c = { -> leftShift('*') }
c.resolveStrategy = Closure.DELEGATE_FIRST
c.delegate = 'aTarget'
c()
{code}
with the same error message.
> ClosureMetaClass wrong routing calls logic
> ------------------------------------------
>
> Key: GROOVY-7480
> URL: https://issues.apache.org/jira/browse/GROOVY-7480
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 2.4.2
> Reporter: Paolo Piersanti
>
> Setting up the resolve strategy to Closure.DELEGATE_FIRST does not
> get the delegate looked up at first. For instance:
> target = 'aTarget'
> c = new GroovyShell().evaluate("{ -> leftShift('*') }");
> c.resolveStrategy = Closure.DELEGATE_FIRST
> c.delegate = target
> c.call()
> results in
> groovy.lang.MissingMethodException: No signature of method:
> Script1$_run_closure1.doCall() is applicable for argument types:
> (java.lang.String) values: [*]
> Possible solutions: doCall(), findAll(), findAll(),
> isCase(java.lang.Object), isCase(java.lang.Object)
> at Script1$_run_closure1.doCall(Script1.groovy:1)
> at ConsoleScript33.run(ConsoleScript33:5)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)