Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use nqp;
- class A { has num $.foo; has num $.baz };
- class B { has str $!bar };
- class C is A is B {
- method new(Num $a, Str $b) {
- my \SELF = nqp::create(self);
- nqp::bindattr_n(SELF, A, '$!foo', nqp::unbox_n($a));
- nqp::bindattr_n(SELF, A, '$!baz', nqp::unbox_n($a));
- nqp::bindattr_s(SELF, B, '$!bar', nqp::unbox_s($b));
- SELF
- }
- };
- C.new(5e0, "5").foo.WHAT.say
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement