diff options
Diffstat (limited to 'tests/js/tbyvar.nim')
-rw-r--r-- | tests/js/tbyvar.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/js/tbyvar.nim b/tests/js/tbyvar.nim index 9714cd56b..40aebd13b 100644 --- a/tests/js/tbyvar.nim +++ b/tests/js/tbyvar.nim @@ -41,3 +41,11 @@ proc bar(s: var seq[int], a: int) = foo(s) s.bar(5) doAssert(s == @[123, 1]) + +import tables +block: # Test get addr of byvar return value + var t = initTable[string, int]() + t["hi"] = 5 + let a = addr t["hi"] + a[] = 10 + doAssert(t["hi"] == 10) |