This commit is contained in:
Andreas Rumpf 2020-01-04 07:40:02 +01:00 • committed by GitHub
commit 0f6987a86e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -1863,11 +1863,11 @@ proc implicitConv(kind: TNodeKind, f: PType, arg: PNode, m: TCandidate,
result = newNodeI(kind, arg.info) result = newNodeI(kind, arg.info)
if containsGenericType(f): if containsGenericType(f):
if not m.hasFauxMatch: if not m.hasFauxMatch:
result.typ = getInstantiatedType(c, arg, m, f) result.typ = getInstantiatedType(c, arg, m, f).skipTypes({tySink})
else: else:
result.typ = errorType(c) result.typ = errorType(c)
else: else:
result.typ = f result.typ = f.skipTypes({tySink})
if result.typ == nil: internalError(c.graph.config, arg.info, "implicitConv") if result.typ == nil: internalError(c.graph.config, arg.info, "implicitConv")
result.add c.graph.emptyNode result.add c.graph.emptyNode
result.add arg result.add arg

View file

@ -100,4 +100,18 @@ mkManyLeaks()
tsimpleClosureIterator() tsimpleClosureIterator()
tleakingNewStmt() tleakingNewStmt()
leakObjConstr() leakObjConstr()
# bug #12964
type
Token* = ref object of RootObj
Li* = ref object of Token
proc bug12964*() =
var token = Li()
var tokens = @[Token()]
tokens.add token
bug12964()
echo getOccupiedMem() - startMem echo getOccupiedMem() - startMem