Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50791

Got "Ambiguous method overloading" for trampoline()

XMLWordPrintable

      I got the following error message when I run a pipeline job, (pipeline script from SCM - git)

      groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Integer#multiply.
      Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
      

       

      Here is the code:

       

      def tailFactorial
      tailFactorial = { int number, BigInteger theFactorial = 1 ->
      number == 1 ? theFactorial :
      tailFactorial.trampoline(number - 1, number * theFactorial)
      }.trampoline()
      println tailFactorial(5)
      

       

      In "Script Console", it runs well.

      Jenkins ver. 2.60.1

      Pipeline job plugin ver: 2.12.1

       

            Unassigned Unassigned
            hubertli Hubert Li
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: