Skip to content

Commit 70f17ac

Browse files
committed
add test case with r:=result
1 parent 0ea9b3c commit 70f17ac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/magics/talias2.nim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,13 @@ block: # fix https://forum.nim-lang.org/t/5015
128128
length := getLength # works
129129
doAssert length("alias") == 5
130130
131+
block: # works with `result` variable too, as asked here:
132+
# https://forum.nim-lang.org/t/5015#31650
133+
proc foo(): string =
134+
r:=result
135+
r.add "ba"
136+
r.add "bo"
137+
doAssert foo() == "babo"
138+
131139
main1()
132140
main2()

0 commit comments

Comments
 (0)