summaryrefslogtreecommitdiff
path: root/src/specialize.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-06-05 16:13:10 +0100
committerAlasdair Armstrong2018-06-06 14:03:03 +0100
commit662a41a6613adf8a00544beb642a90a8e53c9239 (patch)
treefda0581ab659491e98da22334754dad034d04c81 /src/specialize.ml
parent32d850c32ab09012e99b273ed2bccd72ca871051 (diff)
Some work on improving error messages
We now store the location where type variables were bound, so we can use this information when printing error messages. Factor type errors out into type_error.ml. This means that Type_check.check is now Type_error.check, as it previously it handled wrapping the type_errors into reporting_basic errors. Type_check.check' has therefore been renamed to Type_check.check.
Diffstat (limited to 'src/specialize.ml')
-rw-r--r--src/specialize.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/specialize.ml b/src/specialize.ml
index 465c5398..0090cdfd 100644
--- a/src/specialize.ml
+++ b/src/specialize.ml
@@ -429,11 +429,11 @@ let reorder_typedefs (Defs defs) =
let specialize_ids ids ast =
let ast = List.fold_left (fun ast id -> specialize_id id ast) ast (IdSet.elements ids) in
let ast = reorder_typedefs ast in
- let ast, _ = Type_check.check Type_check.initial_env ast in
+ let ast, _ = Type_error.check Type_check.initial_env ast in
let ast =
List.fold_left (fun ast id -> rewrite_polymorphic_calls id ast) ast (IdSet.elements ids)
in
- let ast, env = Type_check.check Type_check.initial_env ast in
+ let ast, env = Type_error.check Type_check.initial_env ast in
let ast = remove_unused_valspecs env ast in
ast, env
@@ -527,7 +527,7 @@ let specialize_variants ((Defs defs) as ast) env =
let ast = Defs (specialize_variants' defs) in
let ast = List.fold_left (fun ast id -> rewrite_polymorphic_constructors id ast) ast !ctors in
- Type_check.check Type_check.initial_env ast
+ Type_error.check Type_check.initial_env ast
let rec specialize ast env =
prerr_endline (Util.log_line __MODULE__ __LINE__ "Performing specialisation pass");