summary refs log tree commit diff stats
path: root/tests/accept/compile
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-laptop>2010-07-21 09:44:47 +0200
committerAndreas Rumpf <andreas@andreas-laptop>2010-07-21 09:44:47 +0200
commitd10973adb00840631e5314ec902d502f15934801 (patch)
treea207854b0cf984815beb26bf2d71933ce566f6d7 /tests/accept/compile
parentc441cdb64ca5394f74faadf76563bcfafeda18f4 (diff)
downloadNim-d10973adb00840631e5314ec902d502f15934801.tar.gz
c2nim tool added
Diffstat (limited to 'tests/accept/compile')
-rw-r--r--tests/accept/compile/tenum3.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/accept/compile/tenum3.nim b/tests/accept/compile/tenum3.nim
new file mode 100644
index 000000000..09a516932
--- /dev/null
+++ b/tests/accept/compile/tenum3.nim
@@ -0,0 +1,16 @@
+# Test enum with explicit size
+
+type
+  TEnumHole {.size: sizeof(int).} = enum 
+    eA = 0,
+    eB = 4,
+    eC = 5
+    
+var
+  e: TEnumHole = eB
+  
+case e
+of eA: echo "A"
+of eB: echo "B"
+of eC: echo "C"
+