On Fri Jul 31 03:19:31 2009, ml...@physik.uni-wuerzburg.de wrote: > 12:16 <@moritz_> rakudo: role A[Int $x where { $x % 2 == 0 }] { method s { > 'even' } }; role A[Int $x where{ $x % 2 == 1 }] { > method s { > 'odd' } }; class X does A[5]; say X.new.s > 12:16 < p6eval> rakudo a53a1c: OUTPUT«Potential internal error: bindability > check may have done more than just binding.Potential > internal > error: bindability check may have done more than just > binding.Ambiguous dispatch to multi '_block50'. Ambiguous > candidates had signatures::(Int $x where all({ ... > })):(Int > 12:16 < p6eval> ..$x whe… > > So the where-clauses didn't have the effect of disambiguating the > dispatch, as they should. > Some tricky hacking later:
role A[Int $x where { $x % 2 == 0 }] { method s { 'even' } } role A[Int $x where { $x % 2 == 1 }] { method s { 'odd' } } class X does A[5] { } say X.new.s; class Y does A[6] { } say Y.new.s; Outputs: odd even \o/ Tests turned on, resolving ticket. Thanks, Jonathan