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 433a7c2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 0 additions & 2 deletions compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,6 @@ proc allPathsAsgnResult(n: PNode): InitResultEnum =
for it in n:
if it.kind == nkFinally:
result = allPathsAsgnResult(it.lastSon)
else:
allPathsInBranch(it.lastSon)
else:
for i in 0..<n.safeLen:
allPathsInBranch(n[i])
Expand Down
17 changes: 17 additions & 0 deletions tests/destructor/tnewruntime_misc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ axc
0 new: 0
...
destroying GenericObj[T] GenericObj[system.int]
test
'''
"""

Expand Down Expand Up @@ -117,3 +118,19 @@ proc main12() =
echo "..."

main12()

#####################################################################
## bug #12827
type
MyObject = object
x: string
y: seq[string]
needs_ref: ref int

proc xx(xml: string): MyObject =
let stream = xml
result.x = xml
defer: echo stream


discard xx("test")

0 comments on commit 433a7c2

Please sign in to comment.