Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldome committed Dec 6, 2019
1 parent 7213969 commit e37c125
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/sempass2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ proc track(tracked: PEffects, n: PNode) =
if n.len == 1: track(tracked, n[0])
of nkBracket:
for i in 0..<n.safeLen: track(tracked, n[i])
if tracked.owner.kind != skMacro:
if tracked.owner.kind != skMacro and n.len > 0:
createTypeBoundOps(tracked, n.typ, n.info)
else:
for i in 0..<n.safeLen: track(tracked, n[i])
Expand Down
7 changes: 7 additions & 0 deletions tests/destructor/t12037.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ proc test() =
doAssert cast[int](sq1[0].unsafeAddr) != 0

test()


#############################################
### bug 12820
import tables
var t = initTable[string, seq[ptr int]]()
discard t.hasKeyOrPut("f1", @[])

0 comments on commit e37c125

Please sign in to comment.