summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/typecheck/fail/and_let_bool.expect13
-rw-r--r--test/typecheck/fail/and_let_bool.sail6
2 files changed, 19 insertions, 0 deletions
diff --git a/test/typecheck/fail/and_let_bool.expect b/test/typecheck/fail/and_let_bool.expect
new file mode 100644
index 00000000..5ab1e377
--- /dev/null
+++ b/test/typecheck/fail/and_let_bool.expect
@@ -0,0 +1,13 @@
+Type error:
+[and_let_bool.sail]:6:11-42
+6 | and_bool(let y : bool = x in not_bool(y), x)
+  | ^-----------------------------^
+  | The type variable 'ex14# would leak into an outer scope.
+  |
+  | Try adding a type annotation to this expression.
+  | This error was caused by:
+  | [and_let_bool.sail]:6:15-16
+  | 6 | and_bool(let y : bool = x in not_bool(y), x)
+  |  | ^
+  |  | Type variable 'ex14# was introduced here
+  |
diff --git a/test/typecheck/fail/and_let_bool.sail b/test/typecheck/fail/and_let_bool.sail
new file mode 100644
index 00000000..152cb355
--- /dev/null
+++ b/test/typecheck/fail/and_let_bool.sail
@@ -0,0 +1,6 @@
+default Order dec
+
+$include <flow.sail>
+
+function test(x) : bool -> bool =
+ and_bool(let y : bool = x in not_bool(y), x)