Skip to content
Browse files

It's always in the timing of things: fix "is default(Nil)"

  • Loading branch information...
1 parent 1145e1c commit 386a090af0c21c0d2d7f29397e79f6ba8a7e3c06 @lizmat lizmat committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/Variable.pm
View
5 src/core/Variable.pm
@@ -35,13 +35,14 @@ multi trait_mod:<is>(Variable:D $v, Mu:U $is ) {
multi trait_mod:<is>(Variable:D $v, :$default!) {
my $var := $v.var;
my $what := $var.VAR.WHAT;
- # make sure we start with the default if a scalar
- $var = $default if nqp::istype($what, Scalar);
nqp::getattr(
$var,
$what.HOW.mixin_base($what),
'$!descriptor',
).set_default(nqp::decont($default));
+
+ # make sure we start with the default if a scalar
+ $var = $default if nqp::istype($what, Scalar);
}
multi trait_mod:<is>(Variable:D $v, :$dynamic!) {
my $var := $v.var;

2 comments on commit 386a090

@xfix

I'm not sure if it makes sense now. It's saving to the variable that isn't used anymore.

@lizmat

$var is the local representation of the actual var being defined

Please sign in to comment.
Something went wrong with that request. Please try again.