Skip to content

Instantly share code, notes, and snippets.

Created November 19, 2016 20:29
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 anonymous/63c3c581c84e4d0347b3cfe0fe36f0c2 to your computer and use it in GitHub Desktop.
Save anonymous/63c3c581c84e4d0347b3cfe0fe36f0c2 to your computer and use it in GitHub Desktop.
module Foo {
my class SingleInheritanceClassHOW
is Metamodel::ClassHOW
{
method add_parent(Mu $obj, Mu $parent) {
if +self.parents($obj, :local) > 0 {
die "Multiple inheritance is forbidden!";
}
callsame;
}
}
my module EXPORTHOW { }
EXPORTHOW.WHO.<class> = SingleInheritanceClassHOW;
}
import Foo;
class A is Int is Str { };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment