Author: jonathan
Date: Wed Jan 7 13:51:09 2009
New Revision: 35175
Modified:
branches/rvar2/languages/perl6/src/builtins/op.pir
Log:
[rakudo] Fix up infix:does for the way we're now doing roles, plus harden it a
little bit. May well have to change again in the face of parametric roles, but
fine for now.
Modified: branches/rvar2/languages/perl6/src/builtins/op.pir
==============================================================================
--- branches/rvar2/languages/perl6/src/builtins/op.pir (original)
+++ branches/rvar2/languages/perl6/src/builtins/op.pir Wed Jan 7 13:51:09 2009
@@ -400,10 +400,15 @@
.local pmc derived
derived = new 'Class'
addparent derived, parrot_class
+ $I0 = isa role, 'NameSpace'
+ unless $I0 goto not_ns
+ role = get_class role
+ not_ns:
$I0 = isa role, 'Role'
if $I0 goto one_role
$I0 = isa role, 'List'
if $I0 goto many_roles
+ error:
'die'("'does' expects a role or a list of roles")
one_role:
@@ -416,6 +421,12 @@
roles_loop:
unless role_it goto roles_loop_end
cur_role = shift role_it
+ $I0 = isa cur_role, 'NameSpace'
+ unless $I0 goto many_not_ns
+ cur_role = get_class cur_role
+ many_not_ns:
+ $I0 = isa cur_role, 'Role'
+ unless $I0 goto error
'!keyword_does'(derived, cur_role)
goto roles_loop
roles_loop_end: