groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: closure calls routing
Date Fri, 26 Jun 2015 04:04:00 GMT
Am 25.06.2015 22:15, schrieb Paolo Piersanti:
> For sure I misunderstood something about how closure calls are routed.
>
>
> For instance in groovy version 2.4.2:
> <----------
> target = 'aTarget'
> c = new GroovyShell().evaluate("{ -> leftShift('*') }");
> c.resolveStrategy = Closure.DELEGATE_ONLY
> c.delegate = target
> c.call()
> ----------->
>
> the result is how expected:
>
> aTarget*
>
> but if I change the strategy to:
> c.resolveStrategy = Closure.DELEGATE_FIRST
>
> the result is:
> Exception thrown
>
> groovy.lang.MissingMethodException: No signature of method:
> Script1$_run_closure1.doCall() is applicable for argument types:

hmmm I wonder if the change 737bbe1f326ca1a43184dde7e544b67be546cc5e 
introduced that. It seems the logic in MetaClassImpl and in 
ClosureMetaClass differ for this case. So we do have a bug for sure. But 
I agree, something is not right here

bye blackdrag


-- 
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/


Mime
View raw message