Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cool.subst-mutate wrapper to handle coercion
We can't simultaneously maintain coercion and 'rw' on the invocant
to Str.subst-mutate.  So we do the two-step shimmy instead.
  • Loading branch information
TimToady committed Apr 6, 2015
1 parent d76ea82 commit 4c1f570
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/Cool.pm
Expand Up @@ -207,6 +207,12 @@ my class Cool { # declared in BOOTSTRAP
$/ := nqp::getlexdyn('$/');
{*}
}
multi method subst-mutate($self is rw: |c) {
$/ := nqp::getlexdyn('$/');
my $str = Str($self);
$str.subst-mutate(|c);
$self = $str;
}

proto method IO(|) { * }
multi method IO(|c) { IO::Path.new(self) }
Expand Down

0 comments on commit 4c1f570

Please sign in to comment.