summary refs log tree commit diff stats
path: root/tests/run
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-04-16 23:40:08 +0200
committerAraq <rumpf_a@web.de>2012-04-16 23:40:08 +0200
commitcb79bf9f163225680969875d95f78d5f4aac44c0 (patch)
treea82c046f0a3969c436b8211285d0b4d088b603f4 /tests/run
parentd4c2f2509c4ce94929ba9b75c16cf34f982da365 (diff)
downloadNim-cb79bf9f163225680969875d95f78d5f4aac44c0.tar.gz
compiler finally supports 'object {.pragma.}' syntax
Diffstat (limited to 'tests/run')
-rw-r--r--tests/run/tfinalobj.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/run/tfinalobj.nim b/tests/run/tfinalobj.nim
new file mode 100644
index 000000000..b559980d6
--- /dev/null
+++ b/tests/run/tfinalobj.nim
@@ -0,0 +1,16 @@
+discard """
+  outp: "abc"
+"""
+
+type
+  TA = object {.pure, final.} 
+    x: string
+    
+var
+  a: TA
+a.x = "abc"
+
+doAssert TA.sizeof == string.sizeof
+
+echo a.x
+