Lua 协同程序 resume : 'resume' 函数参数 #-1 错误 (期望参数为 bool 类型)

我对 lua 相当新手,我继承了一个 lua 代码库,在恢复协程时偶尔会发生错误

-- 创建协程
self._active_test_worker =
        coroutine.create(function(timestep)
            return self._active_test:worker(timestep)
        end)

-- 恢复协程
local temp = type(self._active_test_worker) //thread
local temp2 = type(timestep) // number
local status = coroutine.status(self._active_test_worker) // suspended
local success,action = coroutine.resume(self._active_test_worker, timestep)

“resume”函数会间歇性地引发以下错误

factory.lua:478:'resume' 函数参数 #-1 错误 (期望参数为 bool 类型)

有人可以帮我理解这个错误吗?参数 -1 是什么?(负数在这里意味着什么?)这可能引发什么错误?我在网上或文档中找不到太多关于这个错误的信息。任何帮助都会受到欢迎。

点赞