Skip to content
Permalink
Browse files

Concrete Signature objects can also have roles mixed in

Bypass normal object build logic, just as with Parameter
  • Loading branch information...
lizmat committed Jan 11, 2019
1 parent 3eeb727 commit 9cd42b1f9187ec5284680a78604fc4f1aaaafe14
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/core/Signature.pm6
@@ -8,13 +8,18 @@ my class Signature { # declared in BOOTSTRAP
# has Num $!count; # count
# has Code $!code;

method BUILD(
multi method new(Signature:U:
:@params, Mu :$returns, Int:D :$arity = 0, Num:D :$count = $arity.Num
) {
nqp::create(self)!SET-SELF(@params, $returns, $arity, $count)
}

method !SET-SELF(@params, $returns, $arity, $count) {
nqp::bind(@!params,nqp::getattr(@params,List,'$!reified')),
$!returns := $returns;
$!arity = $arity;
$!count := $count;
self
}

multi method ACCEPTS(Signature:D: Mu \topic) {

0 comments on commit 9cd42b1

Please sign in to comment.
You can’t perform that action at this time.