diff --git a/src/passes/4-typer/typer.ml b/src/passes/4-typer/typer.ml index 5c87cfe62..d1e34fce3 100644 --- a/src/passes/4-typer/typer.ml +++ b/src/passes/4-typer/typer.ml @@ -206,6 +206,14 @@ module Errors = struct ] in error ~data title message () + let deprecated_fail (ae : I.expression) () = + let title () = "fail is deprecated, use failwith instead" in + let message = title in + let data = [ + ("location" , fun () -> Format.asprintf "%a" Location.pp ae.location) ; + ] in + error ~data title message () + let constant_error loc lst tv_opt = let title () = "typing constant" in let message () = "" in @@ -396,7 +404,7 @@ and type_expression : environment -> ?tv_opt:O.type_value -> I.expression -> O.a trace main_error @@ match ae.expression with (* Basic *) - | E_failwith _ -> fail @@ needs_annotation ae "the failwith keyword" + | E_failwith _ -> fail @@ deprecated_fail ae | E_variable name -> let%bind tv' = trace_option (unbound_variable e name ae.location) diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index a2bc4197e..9f598e63b 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -684,7 +684,7 @@ let guess_string_mligo () : unit result = in expect_eq_n program "main" make_input make_expected let basic_mligo () : unit result = - let%bind typed = mtype_file ~debug_simplify:true "./contracts/basic.mligo" in + let%bind typed = mtype_file "./contracts/basic.mligo" in let%bind result = Run.Of_typed.evaluate_entry typed "foo" in Ast_typed.assert_value_eq (Ast_typed.Combinators.e_a_empty_int (42 + 127), result)