diff --git a/src/passes/operators/operators.ml b/src/passes/operators/operators.ml index 8a24cbe1f..ab4527bdc 100644 --- a/src/passes/operators/operators.ml +++ b/src/passes/operators/operators.ml @@ -398,7 +398,10 @@ module Typer = struct let%bind () = assert_eq_1 op_lst (t_list (t_operation ()) ()) in ok @@ (t_pair (t_operation ()) (t_address ()) ()) - let get_contract = typer_1_opt "CONTRACT" @@ fun _ tv_opt -> + let get_contract = typer_1_opt "CONTRACT" @@ fun addr_tv tv_opt -> + if not (type_value_eq (addr_tv, t_address ())) + then fail @@ simple_error (Format.asprintf "get_contract expects an address, got %a" PP.type_value addr_tv) + else let%bind tv = trace_option (simple_error "get_contract needs a type annotation") tv_opt in let%bind tv' =