Merge pull request #1124 from EXetoC/spawn-arg-check
Spawn argument checking.
This commit is contained in:
commit
38892bbf6a
2 changed files with 8 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
7
tests/system/tsysspawnbadarg.nim
Normal file
7
tests/system/tsysspawnbadarg.nim
Normal file
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue