summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/typecheck/fail/scattered_union_rec.expect16
-rw-r--r--test/typecheck/fail/scattered_union_rec.sail6
2 files changed, 22 insertions, 0 deletions
diff --git a/test/typecheck/fail/scattered_union_rec.expect b/test/typecheck/fail/scattered_union_rec.expect
new file mode 100644
index 00000000..cbc9f70a
--- /dev/null
+++ b/test/typecheck/fail/scattered_union_rec.expect
@@ -0,0 +1,16 @@
+Type error:
+[scattered_union_rec.sail]:6:24-25
+6 |union clause U = Ctor : E
+  | ^
+  | Undefined type E
+  | This error was caused by:
+  | [scattered_union_rec.sail]:6:0-25
+  | 6 |union clause U = Ctor : E
+  |  |^-----------------------^
+  |  | Types are not well-formed within this type definition. Note that recursive types are forbidden.
+  | This error was caused by:
+  | [scattered_union_rec.sail]:6:13-14
+  | 6 |union clause U = Ctor : E
+  |  | ^
+  |  | As this is a scattered union clause, this could also be caused by using a type defined after the 'scattered union' declaration
+  |
diff --git a/test/typecheck/fail/scattered_union_rec.sail b/test/typecheck/fail/scattered_union_rec.sail
new file mode 100644
index 00000000..9f005f4e
--- /dev/null
+++ b/test/typecheck/fail/scattered_union_rec.sail
@@ -0,0 +1,6 @@
+
+scattered union U
+
+enum E = A | B | C
+
+union clause U = Ctor : E