CPS-transformed overloaded methods don't route properly

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      (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.

            Assignee:
            Unassigned
            Reporter:
            Andrew Bayer
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: