summaryrefslogtreecommitdiff
path: root/test/typecheck
diff options
context:
space:
mode:
authorAlasdair2018-12-08 01:06:28 +0000
committerAlasdair2018-12-08 02:48:04 +0000
commitd8f0854ca9d80d3af8d6a4aaec778643eda9421c (patch)
treed7d64ccbc3e972ceae549080f62c0c036452c6a6 /test/typecheck
parent2c25110ad2f5e636239ba65a2154aae79ffa253c (diff)
Compiling again
Change Typ_arg_ to A_. We use it a lot more now typ_arg is used instead of uvar as the result of unify. Plus A_ could either stand for argument, or Any/A type which is quite appropriate in most use cases. Restore instantiation info in infer_funapp'. Ideally we would save this instead of recomputing it ever time we need it. However I checked and there are over 300 places in the code that would need to be changed to add an extra argument to E_app. Still some issues causing specialisation to fail however. Improve the error message when we swap how we infer/check an l-expression, as this could previously cause the actual cause of a type-checking failure to be effectively hidden.
Diffstat (limited to 'test/typecheck')
-rw-r--r--test/typecheck/pass/exist_synonym/v1.expect3
-rw-r--r--test/typecheck/pass/exist_synonym/v2.expect3
-rw-r--r--test/typecheck/pass/global_type_var/v1.expect20
-rw-r--r--test/typecheck/pass/global_type_var/v2.expect20
4 files changed, 22 insertions, 24 deletions
diff --git a/test/typecheck/pass/exist_synonym/v1.expect b/test/typecheck/pass/exist_synonym/v1.expect
index 583c4485..fb1b2619 100644
--- a/test/typecheck/pass/exist_synonym/v1.expect
+++ b/test/typecheck/pass/exist_synonym/v1.expect
@@ -3,5 +3,4 @@ Type error at file "exist_synonym/v1.sail", line 6, character 42 to line 6, char
let x : {'n, 0 <= 'n <= 33. regno('n)} = 4
Tried performing type coercion from int(4) to {'n, (0 <= 'n & 'n <= 33). regno('n)} on 4
-Failed because
-Could not prove constraints (0 <= 'n & ('n + 1) <= 32) in type synonym int('n) with (0 <= 'n & 'n <= 33)
+Coercion failed because: Could not prove constraints (0 <= 'n & ('n + 1) <= 32) in type synonym int('n) with (0 <= 'n & 'n <= 33)
diff --git a/test/typecheck/pass/exist_synonym/v2.expect b/test/typecheck/pass/exist_synonym/v2.expect
index baddbcb0..5bde04ba 100644
--- a/test/typecheck/pass/exist_synonym/v2.expect
+++ b/test/typecheck/pass/exist_synonym/v2.expect
@@ -3,5 +3,4 @@ Type error at file "exist_synonym/v2.sail", line 6, character 41 to line 6, char
let x : {'n, 0 <= 'n <= 8. regno('n)} = 4
Tried performing type coercion from int(4) to {'n, (0 <= 'n & 'n <= 8). regno('n)} on 4
-Failed because
-Could not prove constraints (0 <= 'n & ('n + 1) <= 2) in type synonym int('n) with (0 <= 'n & 'n <= 8)
+Coercion failed because: Could not prove constraints (0 <= 'n & ('n + 1) <= 2) in type synonym int('n) with (0 <= 'n & 'n <= 8)
diff --git a/test/typecheck/pass/global_type_var/v1.expect b/test/typecheck/pass/global_type_var/v1.expect
index f190de92..7e3b517c 100644
--- a/test/typecheck/pass/global_type_var/v1.expect
+++ b/test/typecheck/pass/global_type_var/v1.expect
@@ -3,22 +3,22 @@ Type error at file "global_type_var/v1.sail", line 23, character 14 to line 23,
let _ = test(32)
Tried performing type coercion from int(32) to int('size) on 32
-Failed because
-int(32) is not a subtype of int('size)
-in context
-* 'size = 'ex8#
-* ('ex8# = 32 | 'ex8# = 64)
-* ('ex7# = 32 | 'ex7# = 64)
-where
-* 'ex7# bound at file "global_type_var/v1.sail", line 5, character 5 to line 5, character 32
+Coercion failed because:
+ int(32) is not a subtype of int('size)
+ in context
+ * 'size = 'ex8#
+ * ('ex8# = 32 | 'ex8# = 64)
+ * ('ex7# = 32 | 'ex7# = 64)
+ where
+ * 'ex7# bound at file "global_type_var/v1.sail", line 5, character 5 to line 5, character 32
let (size as 'size) : {|32, 64|} = 32
-* 'ex8# bound at file "global_type_var/v1.sail", line 5, character 6 to line 5, character 18
+ * 'ex8# bound at file "global_type_var/v1.sail", line 5, character 6 to line 5, character 18
let (size as 'size) : {|32, 64|} = 32
-* 'size bound at file "global_type_var/v1.sail", line 5, character 14 to line 5, character 18
+ * 'size bound at file "global_type_var/v1.sail", line 5, character 14 to line 5, character 18
let (size as 'size) : {|32, 64|} = 32
diff --git a/test/typecheck/pass/global_type_var/v2.expect b/test/typecheck/pass/global_type_var/v2.expect
index ddfac3e4..dc1281d2 100644
--- a/test/typecheck/pass/global_type_var/v2.expect
+++ b/test/typecheck/pass/global_type_var/v2.expect
@@ -3,22 +3,22 @@ Type error at file "global_type_var/v2.sail", line 23, character 14 to line 23,
let _ = test(64)
Tried performing type coercion from int(64) to int('size) on 64
-Failed because
-int(64) is not a subtype of int('size)
-in context
-* 'size = 'ex8#
-* ('ex8# = 32 | 'ex8# = 64)
-* ('ex7# = 32 | 'ex7# = 64)
-where
-* 'ex7# bound at file "global_type_var/v2.sail", line 5, character 5 to line 5, character 32
+Coercion failed because:
+ int(64) is not a subtype of int('size)
+ in context
+ * 'size = 'ex8#
+ * ('ex8# = 32 | 'ex8# = 64)
+ * ('ex7# = 32 | 'ex7# = 64)
+ where
+ * 'ex7# bound at file "global_type_var/v2.sail", line 5, character 5 to line 5, character 32
let (size as 'size) : {|32, 64|} = 32
-* 'ex8# bound at file "global_type_var/v2.sail", line 5, character 6 to line 5, character 18
+ * 'ex8# bound at file "global_type_var/v2.sail", line 5, character 6 to line 5, character 18
let (size as 'size) : {|32, 64|} = 32
-* 'size bound at file "global_type_var/v2.sail", line 5, character 14 to line 5, character 18
+ * 'size bound at file "global_type_var/v2.sail", line 5, character 14 to line 5, character 18
let (size as 'size) : {|32, 64|} = 32