From 662a41a6613adf8a00544beb642a90a8e53c9239 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Tue, 5 Jun 2018 16:13:10 +0100 Subject: 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. --- src/specialize.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/specialize.ml') 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"); -- cgit v1.2.3