diff options
author | flywind <xzsflywind@gmail.com> | 2021-04-15 01:14:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-14 19:14:14 +0200 |
commit | 44657b78c40475e60187b48157bae41ea5371252 (patch) | |
tree | 09495be60a55a48126a69fbb827fd1a1fea43769 /lib | |
parent | 58f44c8b4e6486789a08555dccee6492d32575d4 (diff) | |
download | Nim-44657b78c40475e60187b48157bae41ea5371252.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/std/tasks.nim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/std/tasks.nim b/lib/std/tasks.nim index 6b7f86ce4..aed36f985 100644 --- a/lib/std/tasks.nim +++ b/lib/std/tasks.nim @@ -75,6 +75,7 @@ proc `=destroy`*(t: var Task) {.inline.} = proc invoke*(task: Task) {.inline.} = ## Invokes the `task`. + assert task.callback != nil task.callback(task.args) template checkIsolate(scratchAssignList: seq[NimNode], procParam, scratchDotExpr: NimNode) = |