fixes #2167
This commit is contained in:
parent
1c88d26ebf
commit
540f66cb09
3 changed files with 12 additions and 5 deletions
|
|
@ -72,8 +72,9 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode,
|
||||||
if cmp < 0: best = z # x is better than the best so far
|
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
|
elif cmp == 0: alt = z # x is as good as the best so far
|
||||||
else: discard
|
else: discard
|
||||||
#if sym.name.s == "shl" and (n.info ?? "net.nim"):
|
#if sym.name.s == "*" and (n.info ?? "temp5.nim"):
|
||||||
# echo "Matches ", n.info, " ", typeToString(sym.typ)
|
# echo "Matches ", n.info, " ", typeToString(sym.typ)
|
||||||
|
# debug sym
|
||||||
# writeMatches(z)
|
# writeMatches(z)
|
||||||
sym = nextOverloadIter(o, c, headSymbol)
|
sym = nextOverloadIter(o, c, headSymbol)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -796,7 +796,7 @@ template ifFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} =
|
||||||
else:
|
else:
|
||||||
# expensive structural equality test; however due to the way generic and
|
# expensive structural equality test; however due to the way generic and
|
||||||
# objects work, if one of the types does **not** contain tfFromGeneric,
|
# objects work, if one of the types does **not** contain tfFromGeneric,
|
||||||
# they cannot be equal. The check ``a.sym.Id == b.sym.Id`` checks
|
# they cannot be equal. The check ``a.sym.id == b.sym.id`` checks
|
||||||
# for the same origin and is essential because we don't want "pure"
|
# for the same origin and is essential because we don't want "pure"
|
||||||
# structural type equivalence:
|
# structural type equivalence:
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -1087,14 +1087,20 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNAdd:
|
of opcNAdd:
|
||||||
decodeBC(rkNode)
|
decodeBC(rkNode)
|
||||||
var u = regs[rb].node
|
var u = regs[rb].node
|
||||||
|
if u.kind notin {nkEmpty..nkNilLit}:
|
||||||
u.add(regs[rc].node)
|
u.add(regs[rc].node)
|
||||||
|
else:
|
||||||
|
stackTrace(c, tos, pc, errGenerated, "cannot add to node kind: " & $u.kind)
|
||||||
regs[ra].node = u
|
regs[ra].node = u
|
||||||
of opcNAddMultiple:
|
of opcNAddMultiple:
|
||||||
decodeBC(rkNode)
|
decodeBC(rkNode)
|
||||||
let x = regs[rc].node
|
let x = regs[rc].node
|
||||||
var u = regs[rb].node
|
var u = regs[rb].node
|
||||||
|
if u.kind notin {nkEmpty..nkNilLit}:
|
||||||
# XXX can be optimized:
|
# XXX can be optimized:
|
||||||
for i in 0.. <x.len: u.add(x.sons[i])
|
for i in 0.. <x.len: u.add(x.sons[i])
|
||||||
|
else:
|
||||||
|
stackTrace(c, tos, pc, errGenerated, "cannot add to node kind: " & $u.kind)
|
||||||
regs[ra].node = u
|
regs[ra].node = u
|
||||||
of opcNKind:
|
of opcNKind:
|
||||||
decodeB(rkInt)
|
decodeB(rkInt)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue