Created
November 19, 2016 20:29
-
-
Save anonymous/63c3c581c84e4d0347b3cfe0fe36f0c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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