This commit is contained in:
Andreas Rumpf
2016-07-06 16:48:00 +02:00
parent 6d9177c6f1
commit e73fd64f38
3 changed files with 28 additions and 10 deletions

View File

@@ -601,6 +601,9 @@ proc evalAtCompileTime(c: PContext, n: PNode): PNode =
result = n
if n.kind notin nkCallKinds or n.sons[0].kind != nkSym: return
var callee = n.sons[0].sym
# workaround for bug #537 (overly aggressive inlining leading to
# wrong NimNode semantics):
if n.typ != nil and tfTriggersCompileTime in n.typ.flags: return
# constant folding that is necessary for correctness of semantic pass:
if callee.magic != mNone and callee.magic in ctfeWhitelist and n.typ != nil: