Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix inverted type test in is default(...).
  • Loading branch information
jnthn committed Sep 19, 2015
1 parent a3962b0 commit a5ef61e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Variable.pm
Expand Up @@ -59,7 +59,7 @@ multi sub trait_mod:<is>(Variable:D $v, :$default!) {
my $of := $descriptor.of;
$v.throw( 'X::Parameter::Default::TypeCheck',
:expected($var.WHAT), :got($default =:= Nil ?? 'Nil' !! $default) )
unless nqp::istype($of, $default.WHAT) or $default =:= Nil or $of =:= Mu;
unless nqp::istype($default.WHAT, $of) or $default =:= Nil or $of =:= Mu;
$descriptor.set_default(nqp::decont($default));

# make sure we start with the default if a scalar
Expand Down

0 comments on commit a5ef61e

Please sign in to comment.