From 0a65347ed2868b815dee532acfebb463f8be644b Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Sat, 22 Dec 2018 00:20:08 +0000 Subject: Improve error messages and debugging Work on improving the formatting and quality of error messages When sail is invoked with sail -i, any type errors now drop the user down to the interactive prompt, with the interactive environment being the environment at the point the type error occurred, this means the typechecker state can be interactively queried in the interpreter to help diagnose type errors. --- src/reporting.mli | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/reporting.mli') diff --git a/src/reporting.mli b/src/reporting.mli index 63ed3eee..4ce0ced8 100644 --- a/src/reporting.mli +++ b/src/reporting.mli @@ -90,8 +90,7 @@ type error = | Err_syntax_locn of Parse_ast.l * string | Err_lex of Lexing.position * string | Err_type of Parse_ast.l * string - | Err_type_dual of Parse_ast.l * Parse_ast.l * string - + exception Fatal_error of error (** [err_todo l m] is an abreviatiation for [Fatal_error (Err_todo (l, m))] *) @@ -106,11 +105,8 @@ val err_unreachable : Parse_ast.l -> (string * int * int * int) -> string -> exn (** [err_typ l m] is an abreviatiation for [Fatal_error (Err_type (l, m))] *) val err_typ : Parse_ast.l -> string -> exn -(** [err_typ_dual l1 l2 m] is an abreviatiation for [Fatal_error (Err_type_dual (l1, l2, m))] *) -val err_typ_dual : Parse_ast.l -> Parse_ast.l -> string -> exn - (** Report error should only be used by main to print the error in the end. Everywhere else, raising a [Fatal_error] exception is recommended. *) -val report_error : error -> 'a +val report_error : error -> unit val print_error : error -> unit -- cgit v1.2.3