diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-10-14 00:00:21 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-10-14 00:00:21 +0200 |
commit | 166720bdf906c20d485b6baadf4c301432dda1de (patch) | |
tree | 9c9995abf1c9794e10d576f4173f553fb1fcabf1 | |
parent | d570dea4807c30ec1463691dc722a9e35e773371 (diff) | |
download | Nim-166720bdf906c20d485b6baadf4c301432dda1de.tar.gz |
Make sure the annotation for `||` is avail. at CT (#9354)
Closes #9353
-rw-r--r-- | compiler/semexprs.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index f4b603589..abd6d1094 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -2043,6 +2043,14 @@ proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = result = setMs(n, s) else: result = c.graph.emptyNode + of mOmpParFor: + checkMinSonsLen(n, 3, c.config) + if n.sonsLen == 4: + let annotationStr = getConstExpr(c.module, semExpr(c, n[^1]), c.graph) + if annotationStr == nil or annotationStr.kind notin nkStrKinds: + localError(c.config, result[^1].info, + "The annotation string for `||` must be known at compile time") + result = semDirectOp(c, n, flags) else: result = semDirectOp(c, n, flags) |