There is no mention of subst-mutate in the design docs. Should I still
write tests in roast?

LL

On Mon, Jan 4, 2016 at 8:52 AM Elizabeth Mattijsen <l...@dijkmat.nl> wrote:

> > On 03 Jan 2016, at 19:12, Zoffix Znet (via RT) <
> perl6-bugs-follo...@perl.org> wrote:
> >
> > # New Ticket Created by  Zoffix Znet
> > # Please include the string:  [perl #127135]
> > # in the subject line of all future correspondence about this issue.
> > # <URL: https://rt.perl.org/Ticket/Display.html?id=127135 >
> >
> >
> > Consider this code that is missing the second argument for .subst-mutate
> method and the error it generates:
> >
> > <Zoffix> m: my $foo = '42'; $foo.subst-mutate: /^'ba'/;
> > <camelia> rakudo-moar b5cb00: OUTPUT«Memory allocation failed; could not
> allocate 19776 bytes␤»
> >
> > What's happening is instead of getting the .subst-mutate from Str type,
> the missing arg causes us to get the one from Cool type:
> https://github.com/rakudo/rakudo/blob/8c001e0a8fc4aacc93eb4327d30071b00f9699fa/src/core/Cool.pm#L267
> >
> > The Cool then stringifies the argument and attempts to call
> .subst-mutate again, with same args, restarting the infinite loop:
> https://github.com/rakudo/rakudo/blob/8c001e0a8fc4aacc93eb4327d30071b00f9699fa/src/core/Cool.pm#L273
> >
> > The number of args in Cool should be detected and error generated.
>
> Fixed with 7d4cdbcdd5fce287afc32 .  Since there are apparently *NO*
> spectests for Str.subst-mutate whatsover, I’m leaving the testing as low
> hanging fruit for someone else.
>
>
> Liz

Reply via email to