diff options
author | Araq <rumpf_a@web.de> | 2014-08-14 00:02:24 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-08-14 00:02:24 +0200 |
commit | f3d530e482249215da56cf1898edd20b51d4480d (patch) | |
tree | 6863258b9fdcac748b5cbf01cad29915e0a192a7 /tests | |
parent | af0de9090ee349b78db44f4fcfb8df46625dea79 (diff) | |
download | Nim-f3d530e482249215da56cf1898edd20b51d4480d.tar.gz |
fixes #1434
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ccgbugs/tmissinginit.nim | 30 | ||||
-rw-r--r-- | tests/misc/tstrange.nim | 3 |
2 files changed, 31 insertions, 2 deletions
diff --git a/tests/ccgbugs/tmissinginit.nim b/tests/ccgbugs/tmissinginit.nim new file mode 100644 index 000000000..36648ef8d --- /dev/null +++ b/tests/ccgbugs/tmissinginit.nim @@ -0,0 +1,30 @@ +discard """ + output: '''0 +0 +0 +0 +[[a = nil, +b = nil]] +""" + +# bug #1475 +type + Crash = object + a: string + b: seq[string] + +proc initCrash(): Crash = discard + +proc test() = + var blongname = [initCrash()] + echo repr(blongname) + +# bug #1434 +proc bug: array[1, int] = discard + +echo bug()[0] +echo bug()[0] +echo bug()[0] +echo bug()[0] + +when isMainModule: test() diff --git a/tests/misc/tstrange.nim b/tests/misc/tstrange.nim index 6bafcabdc..8742011bb 100644 --- a/tests/misc/tstrange.nim +++ b/tests/misc/tstrange.nim @@ -1,7 +1,6 @@ discard """ file: "tstrange.nim" - output: '''hallo4 -0 + output: '''hallo40 1 2''' """ |