replace let _ by let () or add type annotation

This commit is contained in:
zapashcanon 2023-09-09 22:02:39 +02:00
parent 4c6fff9d99
commit 97e5b15531
No known key found for this signature in database
GPG Key ID: 8981C3C62D1D28F1
12 changed files with 14 additions and 15 deletions

View File

@ -14,4 +14,4 @@
License for the specific language governing permissions and limitations under
the License. *)
let _ = Driver.main ()
let () = Driver.main ()

View File

@ -2,7 +2,7 @@ open Catala_utils
open Driver
open Js_of_ocaml
let _ =
let () =
Js.export_all
(object%js
method interpret

View File

@ -26,7 +26,6 @@ let check_invariant (inv : string * invariant_expr) (p : typed program) : bool =
reference *)
let result = ref true in
let name, inv = inv in
let _ = name in
let total = ref 0 in
let ok = ref 0 in
let p' =

View File

@ -630,7 +630,7 @@ let format_scope_exec
for a main scope at the moment."
scope_name_str;
Format.pp_open_vbox fmt 2;
Format.pp_print_string fmt "let _ =";
Format.pp_print_string fmt "let () =";
(* TODO: dump the output using yojson that should be already available from
the runtime *)
Format.pp_print_space fmt ();

View File

@ -414,7 +414,7 @@ module To_jsoo = struct
%a@\n\
%a@\n\
@\n\
@[<v 2>let _ =@ @[<hov 2> Js.export \"%a\"@\n\
@[<v 2>let () =@ @[<hov 2> Js.export \"%a\"@\n\
@[<v 2>(object%%js@ %a@]@\n\
end)@]@]@?"
(Option.fold ~none:"" ~some:(fun name -> name) module_name)

View File

@ -604,7 +604,7 @@ type scope_let_kind =
subscope variables. *)
| CallingSubScope (** [let result = s ({ x = s.x; y = s.x; ...}) ]*)
| DestructuringSubScopeResults (** [let s.x = result.x ]**)
| Assertion (** [let _ = assert e]*)
| Assertion (** [let () = assert e]*)
type 'e scope_let = {
scope_let_kind : scope_let_kind;

View File

@ -228,7 +228,7 @@ let rec optimize_expr :
(* at this point we know a conflict error will be triggered so we just
feed the expression to the interpreter that will print the beautiful
right error message *)
let _ = Interpreter.evaluate_expr ctx.decl_ctx e in
let (_ : _ gexpr) = Interpreter.evaluate_expr ctx.decl_ctx e in
assert false
else
match excepts, just with

View File

@ -1,4 +1,4 @@
let _ =
let () =
let open Alcotest in
run "Optimizations"
[

View File

@ -298,7 +298,7 @@ let driver file debug diff expiration custom_date client_id client_secret =
-1
(** Hook for the executable *)
let _ =
let () =
Stdlib.exit
@@ Cmdliner.Cmd.eval' ~catch:false
(Cmdliner.Cmd.v Legifrance_cli.info

View File

@ -23,7 +23,7 @@ module AF_web = Allocations_familiales_api_web
module AL = Aides_logement
module AL_web = Aides_logement_api_web
let _ =
let () =
Js.export_all
(object%js
val eventsManager = event_manager

View File

@ -228,19 +228,19 @@ let run_test_aides_logement () =
| Runtime.AssertionFailed _ -> ()
let _test =
let _ = run_test_aides_logement () in
let () = run_test_aides_logement () in
let raw_events = Runtime.retrieve_log () in
Runtime.EventParser.parse_raw_events raw_events
let _test =
let _ = run_test_allocations_familiales () in
let () = run_test_allocations_familiales () in
let raw_events = Runtime.retrieve_log () in
Runtime.EventParser.parse_raw_events raw_events
let _bench =
Random.init (int_of_float (Unix.time ()));
let num_iter = 10000 in
let _ =
let (_ : Benchmark.samples) =
Benchmark.latency1 ~style:Auto ~name:"Allocations familiales"
(Int64.of_int num_iter) run_test_allocations_familiales ()
in
@ -254,7 +254,7 @@ let _bench =
100.)
!total_amount
(Float.div !total_amount (float_of_int !num_successful));
let _ =
let (_ : Benchmark.samples) =
Benchmark.latency1 ~style:Auto ~name:"Aides au logement"
(Int64.of_int num_iter) run_test_aides_logement ()
in

View File

@ -8,7 +8,7 @@ let try_test msg test =
failure := true;
Format.printf "@{<red>FAIL@} @{<magenta>%s@}\n" msg
let _ =
let () =
try_test "Allocations familiales #1" Tests_allocations_familiales.test1;
try_test "Allocations familiales #2" Tests_allocations_familiales.test2;
try_test "Allocations familiales #3" Tests_allocations_familiales.test3;