diff --git a/tests/magics/talias2.nim b/tests/magics/talias2.nim index c66984b91fa1b..23c3b5a287ecf 100644 --- a/tests/magics/talias2.nim +++ b/tests/magics/talias2.nim @@ -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()