I don't know if this should be implemented. But at the same time, isn't it just
a matter of using an arg alias?

On 2016-01-05 05:29:15, elizabeth wrote:
> > On 05 Jan 2016, at 02:49, Alex Jakimenko (via RT) <perl6-bugs-
> > follo...@perl.org> wrote:
> >
> > # New Ticket Created by Alex Jakimenko
> > # Please include the string: [perl #127162]
> > # in the subject line of all future correspondence about this issue.
> > # <URL: https://rt.perl.org/Ticket/Display.html?id=127162 >
> >
> >
> > “year” is allowed everywhere:
> >
> > Code:
> > say DateTime.new(year => -50).later(year => 50);
> >
> > Result
> > 0000-01-01T00:00:00
> >
> >
> > “years” is allowed in .later:
> >
> > Code:
> > say DateTime.new(year => -50).later(years => 50);
> >
> > Result
> > 0000-01-01T00:00:00
> >
> >
> > Yet this is not allowed:
> >
> > Code:
> > say DateTime.new(years => -50).later(years => 50);
> >
> > Result
> > Cannot make a DateTime object using .new
> > in block <unit> at -e line 1
> >
> > Actually thrown at:
> > in any at gen/moar/m-Metamodel.nqp line 3041
> > in block <unit> at -e line 1
> >
> >
> >
> > <flussence> why does .later allow "year" and "years", but
> > DateTime.new
> > doesn't?
> >
> > Indeed, not TIMTOWTDI-ish enough.
> > Also, if there is a final decision that it should not be allowed,
> > then at
> > least the error message should not be LTA.
>
> Alas, MMD doesn’t really make this easy. I actually started
> implementing this, but it will make things a *lot* slower. I’m not
> sure it warrants the effort.
>
> Now with regards to the LTAness of the error, I’ve committed
> 75c6b9e84ad74bcd5d5 which now shows:
>
> $ 6 'say DateTime.new(years => -50).later(years => 50)'
> Cannot call DateTime.new with these named parameters: years
>
> Which makes this ticket closable, as far as I’m concerned.
>
>
> Liz

Reply via email to