groovy

list expansion in method call caching causes failing method call

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1-beta-1
  • Fix Version/s: 1.1-beta-2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

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

Activity

Hide
blackdrag blackdrag added a comment -

the caching for list expansions is removed now

Show
blackdrag blackdrag added a comment - the caching for list expansions is removed now
Hide
blackdrag blackdrag added a comment -

wrong fix version

Show
blackdrag blackdrag added a comment - wrong fix version
Hide
blackdrag blackdrag added a comment -

fix version corrected

Show
blackdrag blackdrag added a comment - fix version corrected

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: