Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1963

list expansion in method call caching causes failing method call

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-beta-1
    • 1.1-beta-2
    • None
    • None

    Description

          def methodWithDefaults(a,b,c=1000) {
            a+b+c
          }
          
          assert methodWithDefaults([1,10,100]) == 111
          assert methodWithDefaults([1,10]) == 1011    
      

      when executing this call the last call fails during method invocation, because MetaClassImpl cached the list version that maps to the method variant with 3 arguments, the last call has only 2 arguments so a different method should have been choosen, but that is not the case because the cached method is used

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            blackdrag Jochen Theodorou
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: