summary refs log tree commit diff stats
path: root/tests/template
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-11-17 08:28:24 +0100
committerAraq <rumpf_a@web.de>2014-11-17 08:28:24 +0100
commit729e048a324a6908b6a2d19a7d0186c05880151c (patch)
treeb7fe3838dd03c2f614e921828f7cf627ba7ff7e4 /tests/template
parentfd532b6dab930db7f456700f791065f22c155f9c (diff)
downloadNim-729e048a324a6908b6a2d19a7d0186c05880151c.tar.gz
fixes #940
Diffstat (limited to 'tests/template')
-rw-r--r--tests/template/twrongopensymchoice.nim24
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()