diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/astalgo.nim | 3 | ||||
-rw-r--r-- | compiler/semcall.nim | 8 | ||||
-rw-r--r-- | compiler/semtypinst.nim | 3 | ||||
-rw-r--r-- | compiler/sigmatch.nim | 4 |
4 files changed, 13 insertions, 5 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index ea9534b1f..79c386080 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -387,6 +387,9 @@ proc debugType(n: PType, maxRecDepth=100): PRope = if n.sym != nil: app(result, " ") app(result, n.sym.name.s) + if n.kind in IntegralTypes and n.n != nil: + app(result, ", node: ") + app(result, debugTree(n.n, 2, maxRecDepth-1, renderType=true)) if (n.kind != tyString) and (sonsLen(n) > 0) and maxRecDepth != 0: app(result, "(") for i in countup(0, sonsLen(n) - 1): diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 9077f34e9..56cc9dd9e 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -56,6 +56,9 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode, determineType(c, sym) initCandidate(c, z, sym, initialBinding, o.lastOverloadScope) z.calleeSym = sym + + #if sym.name.s == "*" and (n.info ?? "temp5.nim") and n.info.line == 140: + # gDebug = true matches(c, n, orig, z) if errors != nil: errors.safeAdd(sym) @@ -72,10 +75,13 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode, if cmp < 0: best = z # x is better than the best so far elif cmp == 0: alt = z # x is as good as the best so far else: discard - #if sym.name.s == "*" and (n.info ?? "temp5.nim"): + #if sym.name.s == "*" and (n.info ?? "temp5.nim") and n.info.line == 140: # echo "Matches ", n.info, " ", typeToString(sym.typ) # debug sym # writeMatches(z) + # for i in 1 .. <len(z.call): + # z.call[i].typ.debug + # quit 1 sym = nextOverloadIter(o, c, headSymbol) proc notFoundError*(c: PContext, n: PNode, errors: CandidateErrors) = diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 86826567e..57aa6305e 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -390,9 +390,8 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = else: result = n.typ - of tyInt: + of tyInt, tyFloat: result = skipIntLit(t) - # XXX now there are also float literals of tyTypeDesc: let lookup = PType(idTableGet(cl.typeMap, t)) # lookupTypeVar(cl, t) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 90d889eb0..9f1e98190 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -91,7 +91,7 @@ proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PType) = initIdTable(c.bindings) proc put(t: var TIdTable, key, val: PType) {.inline.} = - idTablePut(t, key, val) + idTablePut(t, key, val.skipIntLit) proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PSym, binding: PNode, calleeScope = -1) = @@ -571,7 +571,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = assert(f != nil) if f.kind == tyExpr: - put(c.bindings, f, aOrig) + if aOrig != nil: put(c.bindings, f, aOrig) return isGeneric assert(aOrig != nil) |