coro icon indicating copy to clipboard operation
coro copied to clipboard

Loops and missing else branches in `async()` functions should return promises to `NULL`

Open lionel- opened this issue 3 years ago • 0 comments

They currently return the exhaustion sentinel which is not thenable:

fn <- async(function() while (FALSE) NULL)

fn()
#> exhausted

promises::then(fn(), ~ NULL)
#> Error in as.promise.default(promise) :
#>   Don't know how to convert object of class name into a promise

For technical reasons this is only an issue in async functions that don't use await(). Low priority.

lionel- avatar Jan 04 '21 10:01 lionel-