callback cannot be nil (#17718)
`Task.callback` cannot be nil, we need to raise it at debug and release mode Situations: - if users create a Task object without using `toTask` and invoke the Task - if users already move the Task and invoke the Task
This commit is contained in:
parent
58f44c8b4e
commit
44657b78c4
1 changed files with 1 additions and 0 deletions
|
|
@ -75,6 +75,7 @@ proc `=destroy`*(t: var Task) {.inline.} =
|
||||||
|
|
||||||
proc invoke*(task: Task) {.inline.} =
|
proc invoke*(task: Task) {.inline.} =
|
||||||
## Invokes the `task`.
|
## Invokes the `task`.
|
||||||
|
assert task.callback != nil
|
||||||
task.callback(task.args)
|
task.callback(task.args)
|
||||||
|
|
||||||
template checkIsolate(scratchAssignList: seq[NimNode], procParam, scratchDotExpr: NimNode) =
|
template checkIsolate(scratchAssignList: seq[NimNode], procParam, scratchDotExpr: NimNode) =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue