summary refs log tree commit diff stats
path: root/tests/compile
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-07-10 22:17:47 +0200
committerAraq <rumpf_a@web.de>2012-07-10 22:17:47 +0200
commit483f28d1cf4baedbce900bc8278e8508127351cc (patch)
tree951af23bbaba3531be7f782a250c07a0bb9cd0de /tests/compile
parent607f46a61afebc7a9e1ab7c66570b6573d91ff6c (diff)
downloadNim-483f28d1cf4baedbce900bc8278e8508127351cc.tar.gz
fixes #147
Diffstat (limited to 'tests/compile')
-rw-r--r--tests/compile/timplictderef.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/compile/timplictderef.nim b/tests/compile/timplictderef.nim
new file mode 100644
index 000000000..99b0b645b
--- /dev/null
+++ b/tests/compile/timplictderef.nim
@@ -0,0 +1,18 @@
+discard """
+  output: "2"
+"""
+
+type
+  TValue* {.pure, final.} = object of TObject
+    a: int
+  PValue = ref TValue
+  PPValue = ptr PValue
+
+
+var x: PValue
+new x
+var sp: PPValue = addr x
+
+sp.a = 2
+if sp.a == 2: echo 2  # with sp[].a the error is gone
+