Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peschwa/1656b1fee687957d3afcec53f1507e38 to your computer and use it in GitHub Desktop.
Save peschwa/1656b1fee687957d3afcec53f1507e38 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment