Skip to content

Commit

Permalink
add test case with r:=result
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jul 26, 2019
1 parent 0ea9b3c commit 70f17ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/magics/talias2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,13 @@ block: # fix https://forum.nim-lang.org/t/5015
length := getLength # works
doAssert length("alias") == 5

block: # works with `result` variable too, as asked here:
# https://forum.nim-lang.org/t/5015#31650
proc foo(): string =
r:=result
r.add "ba"
r.add "bo"
doAssert foo() == "babo"

main1()
main2()

0 comments on commit 70f17ac

Please sign in to comment.