File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -421,8 +421,16 @@ knowhow NQPClassHOW {
421
421
422
422
method publish_type_cache ($ obj ) {
423
423
my @ tc ;
424
- for @ ! mro { nqp :: push (@ tc , $ _ ); }
425
- for @ ! done { nqp :: push (@ tc , $ _ ); }
424
+
425
+ for self . mro($ obj ) {
426
+ nqp :: push (@ tc , $ _ );
427
+ if nqp :: can ($ _ . HOW , ' role_typecheck_list' ) {
428
+ for $ _ . HOW . role_typecheck_list($ _ ) {
429
+ nqp :: push (@ tc , $ _ );
430
+ }
431
+ }
432
+ }
433
+
426
434
nqp ::settypecache($ obj , @ tc )
427
435
}
428
436
@@ -543,6 +551,10 @@ knowhow NQPClassHOW {
543
551
@ ! roles
544
552
}
545
553
554
+ method role_typecheck_list ($ obj ) {
555
+ @ ! done ;
556
+ }
557
+
546
558
method methods ($ obj , : $ local = 0 ) {
547
559
if $ local {
548
560
@ ! method_order
Original file line number Diff line number Diff line change 1
- plan (13 );
1
+ plan (15 );
2
2
3
3
role R1 {
4
4
has $ ! a ;
@@ -38,3 +38,12 @@ ok(!C3.HOW.does(C3, R1));
38
38
ok (C3. HOW . does (C3, R3));
39
39
ok (C3. HOW . does (C3, R4));
40
40
41
+ role Foo {
42
+ }
43
+ class Parent does Foo {
44
+ }
45
+ class Child is Parent {
46
+ };
47
+
48
+ ok (nqp ::istype(Parent, Foo), ' nqp::istype with a role directly on class' );
49
+ ok (nqp ::istype(Child, Foo), ' nqp::istype with a role on a parent class' );
You can’t perform that action at this time.
0 commit comments