-
Bug
-
Resolution: Duplicate
-
Major
-
None
The CPS interpreter does not translate calls to .find() , .findAll() default methods correctly.
The following test case fails:
assert evalCPS("[1,2,3].find { it > 1 }") == 2
I see that groovy-cps has an CpsDefaultGroovyMethods class that provides an alternate implementation of each(). Does this mean that all methods that accept a closure as an argument will also fail?
- is duplicated by
-
JENKINS-26307 CPS Groovy collection.find() returns Boolean
-
- Resolved
-
- is related to
-
JENKINS-26481 Mishandling of binary methods accepting Closure
-
- Resolved
-
-
JENKINS-42635 Passing Closures to NonCPS Library Function give strange results
-
- Resolved
-
I can confirm simple functional-style programming does not seem to work (collect neither). Wondering if I should file another issue, just let me know.
Btw, groovy-cps each() test method indeed fails for me on the github current master (60d8d9c6aa5299baee679e14069e36347973e45f). Wondering if it's platform specific or why Jesse managed to cut the 1.2 two days ago.
Update: the test above fails on Windows, but not on Linux. Didn't investigate as to why.