Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #12964 #13027

Merged
merged 1 commit into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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