Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created May 25, 2014 13:02
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 tadzik/815aa29efaebd5d15adf to your computer and use it in GitHub Desktop.
Save tadzik/815aa29efaebd5d15adf to your computer and use it in GitHub Desktop.
use ClassX::StrictConstructor;
class A {
method new {
say "new from A"
}
}
class B is A does ClassX::StrictConstructor {
has $.a;
method new(*%attrs) {
say "new from B";
self.ClassX::StrictConstructor::new(|%attrs);
}
}
B.new(a => 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment