role Metamodel::RolePunning
role Perl6::Metamodel::RolePunning {}
Warning: this role is part of the Rakudo implementation, and is not a part of the language specification.
Implements the ability to create objects from Role
s without the intermediate
need to use a class. Not intended to be used directly (will in fact error if
it's use
d), but via punning of roles, as below. This is also Rakudo specific
and not part of the spec.
role A {
method b {
return "punned"
}
};
my $a = A.new;
say $a.b; # OUTPUT: «punned»