summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2024-05-17 16:16:49 -0700
committerRose Hogenson <rosehogenson@posteo.net>2024-05-17 16:16:49 -0700
commit92baa4f6bf99efe229abf2ab895cec8fd7a8936d (patch)
treea98c55ed4e8399a31911f0dc944b60894249ea26 /tests
parentc39c43e144733973ebf9cd6842df75b5a5ceee0b (diff)
downloadsml-92baa4f6bf99efe229abf2ab895cec8fd7a8936d.tar.zst
Fix case on datatype.
Diffstat (limited to 'tests')
-rw-r--r--tests/16-datatype.sml9
-rw-r--r--tests/17-case-datatype.sml6
2 files changed, 10 insertions, 5 deletions
diff --git a/tests/16-datatype.sml b/tests/16-datatype.sml
index ee4dd16..7514606 100644
--- a/tests/16-datatype.sml
+++ b/tests/16-datatype.sml
@@ -1,6 +1,5 @@
-datatype D = A | B of int
+datatype D = D of int
-val _ =
- case B 42 of
- B x => __builtin "exit" x
- | _ => __builtin "exit" 0
+fun f (D x) = __builtin "exit" x
+
+val _ = f (D 42)
diff --git a/tests/17-case-datatype.sml b/tests/17-case-datatype.sml
new file mode 100644
index 0000000..974f263
--- /dev/null
+++ b/tests/17-case-datatype.sml
@@ -0,0 +1,6 @@
+datatype D = A | B
+
+val _ =
+ case B of
+ A => __builtin "exit" 0
+ | B => __builtin "exit" 42