-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
There is a pointless assert in the example of "beautiful asynchronous code":
local co = assert(coroutine.running(), "Should be run in a coroutine")Since Lua 5.2, the first value returned by coroutine.running() is always truthy.
Probably, the second returned value must be inspected instead of the first one?
Something like the following:
local co, is_main = coroutine.running()
assert(not is_main, "Should be run in a coroutine")Metadata
Metadata
Assignees
Labels
No labels