Skip to content

Commit

Permalink
Make "my $a will foo" die with a more awesome error message
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jul 26, 2013
1 parent 5622d4a commit 367739f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Variable.pm
Expand Up @@ -34,6 +34,9 @@ multi trait_mod:<is>(Variable:D $v, :$dynamic!) {
}

# phaser traits
multi trait_mod:<will>(Variable:D $v, $block, |c ) {
die "You can not 'will {c.hash.keys}' on a variable";
}
multi trait_mod:<will>(Variable:D $v, $block, :$begin! ) {
$v.block.add_phaser('BEGIN', $block)
}
Expand Down

0 comments on commit 367739f

Please sign in to comment.