Documentation for syntax
is assembled from the following types:
From Type system
multi sub trait_mod:<is>(Mu , Mu )
is accepts a type object to be added as a parent class of a class in its definition. To allow multiple inheritance the trait can be applied more than once. Adding parents to a class will import their methods into the target class. If the same method name occurs in multiple parents, the first added parent will win.
is trait is provided the default of
Any will be used as a parent class. This forces all Perl 6 objects to have the same set of basic methods to provide an interface for introspection and coercion to basic types.
say A.new.^parents(:all).perl;# OUTPUT: «(Any, Mu)␤»is A is Bsay C.new.from-a();# OUTPUT: «A::from-a␤»