diff options
Diffstat (limited to 'compiler/semfold.nim')
-rw-r--r-- | compiler/semfold.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 612df1ba3..089e66abd 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -486,6 +486,8 @@ proc getConstExpr(m: PSym, n: PNode): PNode = of mCpuEndian: result = newIntNodeT(ord(CPU[targetCPU].endian), n) of mHostOS: result = newStrNodeT(toLowerAscii(platform.OS[targetOS].name), n) of mHostCPU: result = newStrNodeT(platform.CPU[targetCPU].name.toLowerAscii, n) + of mBuildOS: result = newStrNodeT(toLowerAscii(platform.OS[platform.hostOS].name), n) + of mBuildCPU: result = newStrNodeT(platform.CPU[platform.hostCPU].name.toLowerAscii, n) of mAppType: result = getAppType(n) of mNaN: result = newFloatNodeT(NaN, n) of mInf: result = newFloatNodeT(Inf, n) @@ -498,7 +500,7 @@ proc getConstExpr(m: PSym, n: PNode): PNode = result = newStrNodeT(lookupSymbol(s.name), n) else: result = copyTree(s.ast) - of {skProc, skMethod}: + of {skProc, skFunc, skMethod}: result = n of skType: # XXX gensym'ed symbols can come here and cannot be resolved. This is @@ -522,7 +524,7 @@ proc getConstExpr(m: PSym, n: PNode): PNode = of nkCallKinds: if n.sons[0].kind != nkSym: return var s = n.sons[0].sym - if s.kind != skProc: return + if s.kind != skProc and s.kind != skFunc: return try: case s.magic of mNone: |