From 9d8b4d60206cc31ed87ac69723930d79fa4d2c89 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 28 May 2019 15:55:11 +0200 Subject: [PATCH] fixes #11057 (#11345) --- compiler/modules.nim | 2 +- compiler/sigmatch.nim | 6 ++++++ lib/pure/json.nim | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/compiler/modules.nim b/compiler/modules.nim index 1b8c7b9581..e45c5786d6 100644 --- a/compiler/modules.nim +++ b/compiler/modules.nim @@ -108,7 +108,7 @@ proc importModule*(graph: ModuleGraph; s: PSym, fileIdx: FileIndex): PSym {.proc # localError(result.info, errAttemptToRedefine, result.name.s) # restore the notes for outer module: graph.config.notes = - if s.owner.id == graph.config.mainPackageId: graph.config.mainPackageNotes + if s.owner.id == graph.config.mainPackageId or isDefined(graph.config, "booting"): graph.config.mainPackageNotes else: graph.config.foreignPackageNotes proc includeModule*(graph: ModuleGraph; s: PSym, fileIdx: FileIndex): PNode {.procvar.} = diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 8065c49929..339af007a4 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1664,6 +1664,12 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, return isGeneric result = typeRel(c, f.base, aa) if result > isGeneric: result = isGeneric + elif c.isNoCall: + if doBind: + let concrete = concreteType(c, a, f) + if concrete == nil: return isNone + put(c, f, concrete) + result = isGeneric else: result = isNone else: diff --git a/lib/pure/json.nim b/lib/pure/json.nim index 2c2b6500f3..d2f0b6e5a7 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -1472,8 +1472,7 @@ proc postProcess(node: NimNode): NimNode = # Create the type. # -> var res = Object() var resIdent = genSym(nskVar, "res") - # TODO: Placing `node[0]` inside quote is buggy - var resType = toIdentNode(node[0]) + var resType = node[0] var objConstr = newTree(nnkObjConstr, resType) result.add newVarStmt(resIdent, objConstr)