summary refs log tree commit diff stats
path: root/tests/js/tenumhole.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/js/tenumhole.nim')
-rw-r--r--tests/js/tenumhole.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/js/tenumhole.nim b/tests/js/tenumhole.nim
new file mode 100644
index 000000000..71a493e8c
--- /dev/null
+++ b/tests/js/tenumhole.nim
@@ -0,0 +1,12 @@
+discard """
+  output: "first0second32third64"
+"""
+
+type Holed = enum
+  hFirst = (0,"first")
+  hSecond = (32,"second")
+  hThird = (64,"third")
+  
+var x = @[0,32,64] # This is just to avoid the compiler inlining the value of the enum
+
+echo Holed(x[0]),ord Holed(x[0]),Holed(x[1]),ord Holed(x[1]),Holed(x[2]),ord Holed(x[2])