parent
c282cee4db
commit
13d232ec56
2 changed files with 22 additions and 4 deletions
|
|
@ -945,11 +945,12 @@ proc allPathsAsgnResult(n: PNode): InitResultEnum =
|
||||||
# assignment this is not good enough! The only pattern we allow for
|
# assignment this is not good enough! The only pattern we allow for
|
||||||
# is 'finally: result = x'
|
# is 'finally: result = x'
|
||||||
result = InitSkippable
|
result = InitSkippable
|
||||||
for it in n:
|
allPathsInBranch(n[0])
|
||||||
if it.kind == nkFinally:
|
for i in 1..<n.len:
|
||||||
result = allPathsAsgnResult(it.lastSon)
|
if n[i].kind == nkFinally:
|
||||||
|
result = allPathsAsgnResult(n[i].lastSon)
|
||||||
else:
|
else:
|
||||||
allPathsInBranch(it.lastSon)
|
allPathsInBranch(n[i].lastSon)
|
||||||
else:
|
else:
|
||||||
for i in 0..<n.safeLen:
|
for i in 0..<n.safeLen:
|
||||||
allPathsInBranch(n[i])
|
allPathsInBranch(n[i])
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ axc
|
||||||
0 new: 0
|
0 new: 0
|
||||||
...
|
...
|
||||||
destroying GenericObj[T] GenericObj[system.int]
|
destroying GenericObj[T] GenericObj[system.int]
|
||||||
|
test
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -117,3 +118,19 @@ proc main12() =
|
||||||
echo "..."
|
echo "..."
|
||||||
|
|
||||||
main12()
|
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")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue