This commit is contained in:
Andreas Rumpf 2019-05-28 15:55:11 +02:00 • committed by GitHub
commit 9d8b4d6020
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) # localError(result.info, errAttemptToRedefine, result.name.s)
# restore the notes for outer module: # restore the notes for outer module:
graph.config.notes = 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 else: graph.config.foreignPackageNotes
proc includeModule*(graph: ModuleGraph; s: PSym, fileIdx: FileIndex): PNode {.procvar.} = 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 return isGeneric
result = typeRel(c, f.base, aa) result = typeRel(c, f.base, aa)
if result > isGeneric: result = isGeneric 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: else:
result = isNone result = isNone
else: else:

View file

@ -1472,8 +1472,7 @@ proc postProcess(node: NimNode): NimNode =
# Create the type. # Create the type.
# -> var res = Object() # -> var res = Object()
var resIdent = genSym(nskVar, "res") var resIdent = genSym(nskVar, "res")
# TODO: Placing `node[0]` inside quote is buggy var resType = node[0]
var resType = toIdentNode(node[0])
var objConstr = newTree(nnkObjConstr, resType) var objConstr = newTree(nnkObjConstr, resType)
result.add newVarStmt(resIdent, objConstr) result.add newVarStmt(resIdent, objConstr)