parent
f4c9eb1774
commit
6be9b98e35
2 changed files with 23 additions and 2 deletions
|
|
@ -181,9 +181,16 @@ proc isPartOf*(a, b: PNode): TAnalysisResult =
|
||||||
else: discard
|
else: discard
|
||||||
of nkObjConstr:
|
of nkObjConstr:
|
||||||
result = arNo
|
result = arNo
|
||||||
for i in 1..<b.len:
|
for i in 1 ..< b.len:
|
||||||
let res = isPartOf(a, b[i][1])
|
let res = isPartOf(a, b[i][1])
|
||||||
if res != arNo:
|
if res != arNo:
|
||||||
result = res
|
result = res
|
||||||
if res == arYes: break
|
if res == arYes: break
|
||||||
|
of nkCall:
|
||||||
|
result = arNo
|
||||||
|
for i in 1 ..< b.len:
|
||||||
|
let res = isPartOf(a, b[i])
|
||||||
|
if res != arNo:
|
||||||
|
result = res
|
||||||
|
if res == arYes: break
|
||||||
else: discard
|
else: discard
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''(10, (20, ))'''
|
output: '''(10, (20, ))
|
||||||
|
42'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import strutils, sequtils
|
import strutils, sequtils
|
||||||
|
|
@ -23,3 +24,16 @@ proc dosomething(): seq[TThing] =
|
||||||
result = @[TThing(data: 10, children: result)]
|
result = @[TThing(data: 10, children: result)]
|
||||||
|
|
||||||
echo($dosomething()[0])
|
echo($dosomething()[0])
|
||||||
|
|
||||||
|
|
||||||
|
# bug #9844
|
||||||
|
|
||||||
|
proc f(v: int): int = v
|
||||||
|
|
||||||
|
type X = object
|
||||||
|
v: int
|
||||||
|
|
||||||
|
var x = X(v: 42)
|
||||||
|
|
||||||
|
x = X(v: f(x.v))
|
||||||
|
echo x.v
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue