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

sample in doc/Type/IO/Socket/Async.pod6 doesn't compile #2449

Closed
coke opened this issue Nov 5, 2018 · 3 comments
Closed

sample in doc/Type/IO/Socket/Async.pod6 doesn't compile #2449

coke opened this issue Nov 5, 2018 · 3 comments
Assignees

Comments

@coke
Copy link
Collaborator

coke commented Nov 5, 2018

=begin code
my $listener = IO::Socket::Async.listen('127.0.0.1', 5000);
my $big-finish = Promise.new;
my $tap = do whenever $listener -> $conn { ... }
await $big-finish;
$tap.close;
=end code

Added in 6a79faf, doesn't compile.

$ xt/examples-compilation.t doc/Type/IO/Socket/Async.pod6
1..22
ok 1 - doc/Type/IO/Socket/Async.pod6 chunk 1 starts with “method nat” compiles
ok 2 - doc/Type/IO/Socket/Async.pod6 chunk 2 starts with “method pee” compiles
ok 3 - doc/Type/IO/Socket/Async.pod6 chunk 3 starts with “method soc” compiles
ok 4 - doc/Type/IO/Socket/Async.pod6 chunk 4 starts with “method pee” compiles
ok 5 - doc/Type/IO/Socket/Async.pod6 chunk 5 starts with “method soc” compiles
ok 6 - doc/Type/IO/Socket/Async.pod6 chunk 6 starts with “method clo” compiles
ok 7 - doc/Type/IO/Socket/Async.pod6 chunk 7 starts with “method Sup” compiles
ok 8 - doc/Type/IO/Socket/Async.pod6 chunk 8 starts with “method wri” compiles
ok 9 - doc/Type/IO/Socket/Async.pod6 chunk 9 starts with “method wri” compiles
ok 10 - doc/Type/IO/Socket/Async.pod6 chunk 10 starts with “method pri” compiles
ok 11 - doc/Type/IO/Socket/Async.pod6 chunk 11 starts with “method pri” compiles
ok 12 - doc/Type/IO/Socket/Async.pod6 chunk 12 starts with “method bin” compiles
ok 13 - doc/Type/IO/Socket/Async.pod6 chunk 13 starts with “method udp” compiles
# my $listener = IO::Socket::Async.listen('127.0.0.1', 5000);
# my $big-finish = Promise.new;
# my $tap = do whenever $listener -> $conn { ... }
# await $big-finish;
# $tap.close;
#
# Cannot have a 'whenever' block outside the scope of a 'supply' or 'react' block
not ok 14 - doc/Type/IO/Socket/Async.pod6 chunk 14 starts with “my $listen” compiles
# Failed test 'doc/Type/IO/Socket/Async.pod6 chunk 14 starts with “my $listen” compiles'
# at xt/examples-compilation.t line 148
ok 15 - doc/Type/IO/Socket/Async.pod6 chunk 15 starts with “my $listen” compiles
ok 16 - doc/Type/IO/Socket/Async.pod6 chunk 16 starts with “method lis” compiles
ok 17 - doc/Type/IO/Socket/Async.pod6 chunk 17 starts with “method con” compiles
ok 18 - doc/Type/IO/Socket/Async.pod6 chunk 18 starts with “react {” compiles
ok 19 - doc/Type/IO/Socket/Async.pod6 chunk 19 starts with “my $socket” compiles
ok 20 - doc/Type/IO/Socket/Async.pod6 chunk 20 starts with “my $socket” compiles
ok 21 - doc/Type/IO/Socket/Async.pod6 chunk 21 starts with “await IO::” compiles
ok 22 - doc/Type/IO/Socket/Async.pod6 chunk 22 starts with “class IO::” compiles
# Looks like you failed 1 test of 22
@coke coke assigned JJ Nov 5, 2018
@jmaslak
Copy link
Contributor

jmaslak commented Nov 5, 2018

#2448 addresses this.

@jmaslak
Copy link
Contributor

jmaslak commented Nov 5, 2018

Merged #2448 which should correct this.

@jmaslak jmaslak closed this as completed Nov 5, 2018
@JJ
Copy link
Contributor

JJ commented Nov 5, 2018

That was fast, @jmaslak Thanks!

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

No branches or pull requests

3 participants