diff options
-rw-r--r-- | compiler/semfold.nim | 2 | ||||
-rw-r--r-- | tests/system/tsysspawnbadarg.nim | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim index caaab2291..79abfaf4d 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -404,7 +404,7 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = mExit, mInc, ast.mDec, mEcho, mSwap, mAppendStrCh, mAppendStrStr, mAppendSeqElem, mSetLengthStr, mSetLengthSeq, mParseExprToAst, mParseStmtToAst, mExpandToAst, mTypeTrait, - mNLen..mNError, mEqRef, mSlurp, mStaticExec, mNGenSym: + mNLen..mNError, mEqRef, mSlurp, mStaticExec, mNGenSym, mSpawn: discard of mRand: result = newIntNodeT(math.random(a.getInt.int), n) diff --git a/tests/system/tsysspawnbadarg.nim b/tests/system/tsysspawnbadarg.nim new file mode 100644 index 000000000..ace074602 --- /dev/null +++ b/tests/system/tsysspawnbadarg.nim @@ -0,0 +1,7 @@ +discard """ + line: 7 + errormsg: "'spawn' takes a call expression of type void" + cmd: "nimrod $target --threads:on $options $file" +""" + +spawn(1) |