diff --git a/src/core/asyncops.pm b/src/core/asyncops.pm index 50df8ea8266..e517f5b2f1e 100644 --- a/src/core/asyncops.pm +++ b/src/core/asyncops.pm @@ -7,7 +7,10 @@ proto sub await(|) { * } multi sub await() { die "Must specify a Promise or Channel to await on (got an empty list)"; } -multi sub await(Any $x) { +multi sub await(Any:U $x) { + die "Must specify a defined Promise or Channel to await on (got an undefined $x.^name())"; +} +multi sub await(Any:D $x) { die "Must specify a Promise or Channel to await on (got a $x.^name())"; } multi sub await(Iterable:D $i) { $i.eager.map({ await $_ }) }