diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-06-30 00:43:19 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-06-30 00:43:19 +0200 |
commit | d9d61fbeb4e0514c94dbe9e5d350d4f0d0af4313 (patch) | |
tree | 930690ee521d5ce3e03f8c215ca039f6309a6d4f /tests/js | |
parent | ad64b66df1b20c78280251138345727ed8033ccd (diff) | |
download | Nim-d9d61fbeb4e0514c94dbe9e5d350d4f0d0af4313.tar.gz |
fixes #5517
Diffstat (limited to 'tests/js')
-rw-r--r-- | tests/js/trefbyvar.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/js/trefbyvar.nim b/tests/js/trefbyvar.nim index 314a02543..d440fcc64 100644 --- a/tests/js/trefbyvar.nim +++ b/tests/js/trefbyvar.nim @@ -52,3 +52,18 @@ input.add(nil) input.add(new string) input[1][] = "~" echo input[1][] + +# bug #5517 +type + TypeA1 = object of RootObj + a_impl: int + b_impl: string + c_impl: pointer + +proc initTypeA1(a: int; b: string; c: pointer = nil): TypeA1 = + result.a_impl = a + result.b_impl = b + result.c_impl = c + +let x = initTypeA1(1, "a") +doAssert($x == "(a_impl: 1, b_impl: a, c_impl: ...)") |