Merge pull request #1124 from EXetoC/spawn-arg-check

Spawn argument checking.
This commit is contained in:
Andreas Rumpf
2014-04-20 23:34:21 +02:00
2 changed files with 8 additions and 1 deletions

View File

@@ -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)

View 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)