On Sat Dec 13 07:59:45 2008, masak wrote: > <masak> rakudo: sub foo(&code_block where { 1 <= .arity <= 2 }) { say > "OH HAI" }; foo(1) > <p6eval> rakudo 33858: OUTPUT[Method 'arity' not found for invocant of > class 'Int'current instr.: '_block23' pc 417 (EVAL_14:163)] > <masak> what does Int have to do with it? > <pmichaud> masak: you didn't pass a code block. > <pmichaud> you sent it an Int. > <masak> oh. > <jnthn> we should fail
And now we do fail, as of r34020. Which in this case is good, because I can add another test that wins. Uh, passes. Note that as a result of this, multi-dispatch automatically now differentiates the two as well! > multi bar($x) { 1 } > multi bar(&x) { 2 } > say bar(42) 1 > say bar({42}) 2 Have fun, Jonathan