-
Bug
-
Resolution: Unresolved
-
Major
-
None
(opened in workflow-cps-plugin component since there isn't one for groovy-cps)
If you have two overloaded methods where the parameter for one is a superclass of the other, with the child class overloaded method casting to the superclass and calling the superclass overloaded method, and then you call the overloaded method with an instance of the child class as the parameter, you end up in a StackOverflowError, with the child class overloaded method called over and over.
i.e.,
public String bar(List<String> l) { return bar((Iterable)l) } public String bar(Iterable<String> l) { return "iterable" } List<String> s = ["a", "b"] bar(s) == "iterable"
will never complete. Adding the @NonCPS annotation to the bar methods makes it work.
- links to
So the core problem here is that Builder.cast(int,Block,Class,boolean) doesn't actually do anything useful, so far as I can tell. We don't seem to keep track of return type information at all! Ow.