Skip to content

Commit

Permalink
Merge pull request #18 from nim-lang/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
sthagen authored Jan 4, 2020
2 parents efbee36 + 0f6987a commit b490442
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/sigmatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1863,11 +1863,11 @@ proc implicitConv(kind: TNodeKind, f: PType, arg: PNode, m: TCandidate,
result = newNodeI(kind, arg.info)
if containsGenericType(f):
if not m.hasFauxMatch:
result.typ = getInstantiatedType(c, arg, m, f)
result.typ = getInstantiatedType(c, arg, m, f).skipTypes({tySink})
else:
result.typ = errorType(c)
else:
result.typ = f
result.typ = f.skipTypes({tySink})
if result.typ == nil: internalError(c.graph.config, arg.info, "implicitConv")
result.add c.graph.emptyNode
result.add arg
Expand Down
14 changes: 14 additions & 0 deletions tests/destructor/tarc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,18 @@ mkManyLeaks()
tsimpleClosureIterator()
tleakingNewStmt()
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

0 comments on commit b490442

Please sign in to comment.