diff --git a/compiler/modules.nim b/compiler/modules.nim index d653e8b8f..9a7f68495 100644 --- a/compiler/modules.nim +++ b/compiler/modules.nim @@ -105,10 +105,14 @@ proc checkDepMem(fileIdx: int32): TNeedRecompile = resetModule(fileIdx) return Yes - # cycle detection: We claim that a cycle does no harm. - if gMemCacheData[fileIdx].needsRecompile == Probing: - return No - #return gMemCacheData[fileIdx].needsRecompile + when true: + if gMemCacheData[fileIdx].needsRecompile != Maybe: + return gMemCacheData[fileIdx].needsRecompile + else: + # cycle detection: We claim that a cycle does no harm. + if gMemCacheData[fileIdx].needsRecompile == Probing: + return No + #return gMemCacheData[fileIdx].needsRecompile if optForceFullMake in gGlobalOptions or hashChanged(fileIdx): markDirty() diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 7aeaa475f..8ce29d299 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1635,8 +1635,8 @@ proc newAnonSym(kind: TSymKind, info: TLineInfo, result.flags = {sfGenSym} proc semExpandToAst(c: PContext, n: PNode): PNode = - var macroCall = n[1] - var expandedSym = expectMacroOrTemplateCall(c, macroCall) + let macroCall = n[1] + let expandedSym = expectMacroOrTemplateCall(c, macroCall) if expandedSym.kind == skError: return n macroCall.sons[0] = newSymNode(expandedSym, macroCall.info) @@ -1644,13 +1644,13 @@ proc semExpandToAst(c: PContext, n: PNode): PNode = styleCheckUse(n.info, expandedSym) for i in countup(1, macroCall.len-1): + #if macroCall.sons[0].typ.sons[i].kind != tyExpr: macroCall.sons[i] = semExprWithType(c, macroCall[i], {}) # Preserve the magic symbol in order to be handled in evals.nim internalAssert n.sons[0].sym.magic == mExpandToAst - #n.typ = getSysSym("PNimrodNode").typ # expandedSym.getReturnType - n.typ = if getCompilerProc("NimNode") != nil: sysTypeFromName"NimNode" - else: sysTypeFromName"PNimrodNode" + #n.typ = getSysSym("NimNode").typ # expandedSym.getReturnType + n.typ = sysTypeFromName"NimNode" result = n proc semExpandToAst(c: PContext, n: PNode, magicSym: PSym,