I have this action which overrides an action in another action class:
method taskwiki-prefix($/ is copy) {
my $prefix = $/.Str;
$prefix ~~ s:g!'|'!!;
make $prefix;
}
The substitution throws this error:
P6opaque: no such attribute '$!made' on type Match in a List when trying to bind a value
If I comment out the substitution, the error goes away. dd $prefix
shows:
Str $prefix = " Tasks ||"
So it's just a plain string.
If I remove the :g
adverb, no more error, but doing that makes the made value Nil
and nothing shows up in the output for $<taskwiki-prefix>.made
.
Looks to me like there is some bad interaction going on with the matches in the substitution and the action, if I were to guess.
Any fix?
//
"defined-or" operator, à la// ""
. Does the "defined-or" operator have a place/use in Grammars as well? See: unix.stackexchange.com/a/696979/227738 – Vanbuskirk