diff options
author | Araq <rumpf_a@web.de> | 2014-11-17 08:28:24 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-11-17 08:28:24 +0100 |
commit | 729e048a324a6908b6a2d19a7d0186c05880151c (patch) | |
tree | b7fe3838dd03c2f614e921828f7cf627ba7ff7e4 /tests/template | |
parent | fd532b6dab930db7f456700f791065f22c155f9c (diff) | |
download | Nim-729e048a324a6908b6a2d19a7d0186c05880151c.tar.gz |
fixes #940
Diffstat (limited to 'tests/template')
-rw-r--r-- | tests/template/twrongopensymchoice.nim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/template/twrongopensymchoice.nim b/tests/template/twrongopensymchoice.nim new file mode 100644 index 000000000..5a02a813c --- /dev/null +++ b/tests/template/twrongopensymchoice.nim @@ -0,0 +1,24 @@ +discard """ + output: '''10''' +""" + +# bug #940 + +type + Foo* = ref object + b*: int + +proc new*(this: var Foo) = + assert this != nil + this.b = 10 + +proc new*(T: typedesc[Foo]): Foo = + system.new(result) + twrongopensymchoice.new(result) + +proc main = + var f = Foo.new() + echo f.b + +when isMainModule: + main() |