[squeak-dev] Wrong error message from BlockClosure ?

karl ramberg karlramberg at gmail.com
Thu Apr 30 10:25:31 UTC 2015


#(1 2) do:[:a :b| b] "do it"

Error: 'This block accepts 2 argument, but was called with 1 arguments.'

Should not the numArgs and the numArgsForInvocation switch place here ?

BlockClosure>>numArgsError: numArgsForInvocation

| printNArgs |
printNArgs := [:n| n printString, ' argument', (n = 1 ifTrue: ['']
ifFalse:['s'])].
self error:
'This block accepts ', (printNArgs value: numArgs),
', but was called with ', (printNArgs value: numArgsForInvocation), '.'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20150430/f0243efd/attachment.htm


More information about the Squeak-dev mailing list