mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #2167
This commit is contained in:
@@ -72,8 +72,9 @@ 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 == "shl" and (n.info ?? "net.nim"):
|
||||
#if sym.name.s == "*" and (n.info ?? "temp5.nim"):
|
||||
# echo "Matches ", n.info, " ", typeToString(sym.typ)
|
||||
# debug sym
|
||||
# writeMatches(z)
|
||||
sym = nextOverloadIter(o, c, headSymbol)
|
||||
|
||||
|
||||
@@ -796,7 +796,7 @@ template ifFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} =
|
||||
else:
|
||||
# expensive structural equality test; however due to the way generic and
|
||||
# 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"
|
||||
# structural type equivalence:
|
||||
#
|
||||
|
||||
@@ -1087,14 +1087,20 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
of opcNAdd:
|
||||
decodeBC(rkNode)
|
||||
var u = regs[rb].node
|
||||
u.add(regs[rc].node)
|
||||
if u.kind notin {nkEmpty..nkNilLit}:
|
||||
u.add(regs[rc].node)
|
||||
else:
|
||||
stackTrace(c, tos, pc, errGenerated, "cannot add to node kind: " & $u.kind)
|
||||
regs[ra].node = u
|
||||
of opcNAddMultiple:
|
||||
decodeBC(rkNode)
|
||||
let x = regs[rc].node
|
||||
var u = regs[rb].node
|
||||
# XXX can be optimized:
|
||||
for i in 0.. <x.len: u.add(x.sons[i])
|
||||
if u.kind notin {nkEmpty..nkNilLit}:
|
||||
# XXX can be optimized:
|
||||
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
|
||||
of opcNKind:
|
||||
decodeB(rkInt)
|
||||
|
||||
Reference in New Issue
Block a user