Issue Details (XML | Word | Printable)

Key: GROOVY-1963
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Jochen Theodorou
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

list expansion in method call caching causes failing method call

Created: 02/Jul/07 05:03 AM   Updated: 02/Jul/07 05:05 AM
Component/s: None
Affects Version/s: 1.1-beta-1
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified


 Description  « Hide
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



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jochen Theodorou added a comment - 02/Jul/07 05:04 AM
the caching for list expansions is removed now

Jochen Theodorou added a comment - 02/Jul/07 05:04 AM
wrong fix version

Jochen Theodorou added a comment - 02/Jul/07 05:05 AM
fix version corrected