Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"await" without args does nothing but produces no error #4268

Closed
p6rt opened this issue May 27, 2015 · 9 comments
Closed

"await" without args does nothing but produces no error #4268

p6rt opened this issue May 27, 2015 · 9 comments

Comments

@p6rt
Copy link

p6rt commented May 27, 2015

Migrated from rt.perl.org#125257 (status was 'resolved')

Searchable as RT125257$

@p6rt
Copy link
Author

p6rt commented May 27, 2015

From @AlexDaniel

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.

@p6rt
Copy link
Author

p6rt commented May 28, 2015

From @lizmat

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-followup@​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-archive.perl.org/perl6/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.

@p6rt
Copy link
Author

p6rt commented May 28, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 29, 2015

From @AlexDaniel

Also, this error is not compile-time as I have suggested. Is there any
reason for that?

On Wed, May 27, 2015 at 4​:52 PM, perl6 via RT <perl6-bugs-followup@​perl.org>
wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
""await" without args does nothing but produces no error",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #​125257].

Please include the string​:

     \[perl #&#8203;125257\]

in the subject line of all future correspondence about this issue. To do
so,
you may reply to this message.

                    Thank you,
                    perl6\-bugs\-followup@&#8203;perl\.org

-------------------------------------------------------------------------
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.

@p6rt
Copy link
Author

p6rt commented May 29, 2015

From @AlexDaniel

It does not say "===SORRY!===", is it OK?

On Thu, May 28, 2015 at 7​:09 PM, Elizabeth Mattijsen via RT <
perl6-bugs-followup@​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-followup@​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-archive.perl.org/perl6/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.

@p6rt
Copy link
Author

p6rt commented May 29, 2015

From @lizmat

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.jakimenko@​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-followup@​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-followup@​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-archive.perl.org/perl6/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.

@p6rt
Copy link
Author

p6rt commented Jun 30, 2015

From @usev6

I added a simple test (only testing whether bare "await" dies, no check for the error message) to S17-promise/basic.t with commit Raku/roast@305ca31ff7

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 30, 2015

From @usev6

I added a simple test (only testing whether bare "await" dies, no check for the error message) to S17-promise/basic.t with commit Raku/roast@305ca31ff7

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Jun 30, 2015
@p6rt
Copy link
Author

p6rt commented Jun 30, 2015

@usev6 - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant