diff --git a/src/compilerlib/pb_codegen_services.ml b/src/compilerlib/pb_codegen_services.ml index 5cb39e82..1979eaf9 100644 --- a/src/compilerlib/pb_codegen_services.ml +++ b/src/compilerlib/pb_codegen_services.ml @@ -115,7 +115,9 @@ let gen_service_client_struct (service : Ot.service) sc : unit = let res, res_mode = ocaml_type_of_rpc_type rpc.rpc_res in F.linep sc " () : (%s, %s, %s, %s) Client.rpc)" req req_mode res res_mode in - F.sub_scope sc (fun sc -> List.iter (gen_rpc sc) service.service_body); + F.sub_scope sc (fun sc -> + F.linep sc "open Pbrt_services"; + List.iter (gen_rpc sc) service.service_body); F.line sc "end" let gen_service_server_struct (service : Ot.service) sc : unit = @@ -183,7 +185,6 @@ let gen_service_server_struct (service : Ot.service) sc : unit = let gen_service_struct (service : Ot.service) sc : unit = F.linep sc "module %s = struct" (mod_name_for_client service); F.sub_scope sc (fun sc -> - F.linep sc "open Pbrt_services"; F.linep sc "open Pbrt_services.Value_mode"; gen_service_client_struct service sc;