diff options
Diffstat (limited to 'lib/std')
-rw-r--r-- | lib/std/tasks.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/tasks.nim b/lib/std/tasks.nim index ac35e26bf..055ddf144 100644 --- a/lib/std/tasks.nim +++ b/lib/std/tasks.nim @@ -110,7 +110,8 @@ macro toTask*(e: typed{nkCall | nkInfix | nkPrefix | nkPostfix | nkCommand | nkC let b = toTask hello(13) assert b is Task - doAssert getTypeInst(e).typeKind == ntyVoid + if getTypeInst(e).typeKind != ntyVoid: + error("'toTask' cannot accept a call with a return value", e) when compileOption("threads"): if not isGcSafe(e[0]): |