That is correct.  At the moment we cannot catch this elegantly at compile time, 
because the candidate with the slurpy takes the no arg case as well.  So the 
only way to catch the no arg case, is to create a candidate for it that dies.  
Which makes it runtime.

Since await, from the grammar point of view, is just a sub like any other sub, 
there is no (easy) way to catch the no arg case in the grammar.

It’s for cases like this, I would like to see some language support for 
specifying a slurpy that takes at least 1 argument (as opposed to currently at 
least 0).

Technically, it *is* possible to create a candidate that takes 1 param + a 
slurpy, and this cause the no arg case to become a compile time error because 
of lack of a candidate, but then the error message about which candidates *are* 
possible, becomes very confusing.

So, I think having it die at runtime is the best we can do at the moment.



Liz
===============
> On 28 May 2015, at 22:04, Alex Jakimenko <alex.jakime...@gmail.com> wrote:
> 
> It does not say "===SORRY!===", is it OK?
> 
> On Thu, May 28, 2015 at 7:09 PM, Elizabeth Mattijsen via RT 
> <perl6-bugs-follo...@perl.org> wrote:
> A bare await now throws an error (with d841d4e14f04c49a19c32)
> 
> $ 6 'await'
> Must specify a Promise or Channel to await on
>   in block <unit> at -e:1
> 
> Liz
> 
> > On 27 May 2015, at 15:52, Alex Jakimenko (via RT) 
> > <perl6-bugs-follo...@perl.org> wrote:
> >
> > # New Ticket Created by  Alex Jakimenko
> > # Please include the string:  [perl #125257]
> > # in the subject line of all future correspondence about this issue.
> > # <URL: https://rt.perl.org/Ticket/Display.html?id=125257 >
> >
> >
> > Somehow I expected that "await" without args would wait for everything, but
> > it does not do that. At the same time, the code like:
> >
> > await;
> >
> > is still legal and produces no error or warning. This should probably be a
> > compile-time error.
> 
> 
> 

Reply via email to