diff --git a/src/proto_alpha/lib_client/client_proto_programs_commands.ml b/src/proto_alpha/lib_client/client_proto_programs_commands.ml index 98a8647d5..b31258c65 100644 --- a/src/proto_alpha/lib_client/client_proto_programs_commands.ml +++ b/src/proto_alpha/lib_client/client_proto_programs_commands.ml @@ -102,15 +102,21 @@ let commands () = @@ Program.source_param @@ stop) (fun (show_types, emacs_mode, no_print_source) program cctxt -> - Lwt.return @@ Micheline_parser.no_parsing_error program >>=? fun program -> - typecheck_program program cctxt#block cctxt >>= fun res -> - print_typecheck_result - ~emacs:emacs_mode - ~show_types - ~print_source_on_error:(not no_print_source) - program - res - cctxt) ; + match program with + | program, [] -> + typecheck_program program cctxt#block cctxt >>= fun res -> + print_typecheck_result + ~emacs:emacs_mode + ~show_types + ~print_source_on_error:(not no_print_source) + program + res + cctxt + | res_with_errors -> + cctxt#message + "(@[(types . ())@ (errors . %a)@])" + Michelson_v1_emacs.report_errors res_with_errors >>= fun () -> + return ()) ; command ~group ~desc: "Ask the node to typecheck a data expression." (args1 no_print_source_flag)