This commit is contained in:
Andreas Rumpf
2019-05-28 15:55:11 +02:00
committed by GitHub
parent 1f8c9aff1f
commit 9d8b4d6020
3 changed files with 8 additions and 3 deletions

View File

@@ -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.} =

View File

@@ -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:

View File

@@ -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)