diff --git a/compiler/core/js_of_lam_block.ml b/compiler/core/js_of_lam_block.ml index 9bb1a0b2c3..850e8ad2f9 100644 --- a/compiler/core/js_of_lam_block.ml +++ b/compiler/core/js_of_lam_block.ml @@ -33,7 +33,7 @@ let make_block mutable_flag (tag_info : Lam_tag_info.t) tag args = let field (field_info : Lam_compat.field_dbg_info) e (i : int32) = match field_info with - | Fld_tuple | Fld_array -> + | Fld_tuple -> E.array_index_by_int ?comment:(Lam_compat.str_of_field_info field_info) e i | Fld_poly_var_content -> E.poly_var_value_access e | Fld_poly_var_tag -> E.poly_var_tag_access e diff --git a/compiler/core/lam_analysis.ml b/compiler/core/lam_analysis.ml index a95b382ca2..9bd4581ef4 100644 --- a/compiler/core/lam_analysis.ml +++ b/compiler/core/lam_analysis.ml @@ -97,8 +97,7 @@ let rec no_side_effects (lam : Lam.t) : bool = (* TODO *) | Praw_js_code _ (* byte swap *) - | Parraysets | Parraysetu | Poffsetref _ | Praise | Plazyforce | Psetfield _ - -> + | Parraysets | Parraysetu | Poffsetref _ | Praise | Psetfield _ -> false) | Llet (_, _, arg, body) -> no_side_effects arg && no_side_effects body | Lswitch (_, _) -> false diff --git a/compiler/core/lam_compat.ml b/compiler/core/lam_compat.ml index bf7b08157e..a652d74ca4 100644 --- a/compiler/core/lam_compat.ml +++ b/compiler/core/lam_compat.ml @@ -73,11 +73,10 @@ type field_dbg_info = Lambda.field_dbg_info = | Fld_extension | Fld_variant | Fld_cons - | Fld_array let str_of_field_info (x : field_dbg_info) : string option = match x with - | Fld_array | Fld_extension | Fld_variant | Fld_cons | Fld_poly_var_tag + | Fld_extension | Fld_variant | Fld_cons | Fld_poly_var_tag | Fld_poly_var_content | Fld_tuple -> None | Fld_record {name; _} diff --git a/compiler/core/lam_compat.mli b/compiler/core/lam_compat.mli index 4a1c94217e..4d67d95242 100644 --- a/compiler/core/lam_compat.mli +++ b/compiler/core/lam_compat.mli @@ -37,7 +37,6 @@ type field_dbg_info = Lambda.field_dbg_info = | Fld_extension | Fld_variant | Fld_cons - | Fld_array val str_of_field_info : field_dbg_info -> string option diff --git a/compiler/core/lam_compile_primitive.ml b/compiler/core/lam_compile_primitive.ml index c33a329283..6f3f16686a 100644 --- a/compiler/core/lam_compile_primitive.ml +++ b/compiler/core/lam_compile_primitive.ml @@ -605,13 +605,3 @@ let translate output_prefix loc (cxt : Lam_compile_context.t) match args with | [e1] -> E.runtime_call Primitive_modules.hash "hash_final_mix" args | _ -> assert false) - | Plazyforce - (* FIXME: we don't inline lazy force or at least - let buckle handle it - *) - (* let parm = Ident.create "prim" in - Lfunction(Curried, [parm], - Matching.inline_lazy_force (Lvar parm) Location.none) - It is inlined, this should not appear here *) - -> - assert false diff --git a/compiler/core/lam_constant_convert.ml b/compiler/core/lam_constant_convert.ml index ad0e7de05a..938977d581 100644 --- a/compiler/core/lam_constant_convert.ml +++ b/compiler/core/lam_constant_convert.ml @@ -63,7 +63,6 @@ let rec convert_constant (const : Lambda.structured_constant) : Lam_constant.t = if Ext_string.is_valid_hash_number name then Const_int {i = Ext_string.hash_number_as_i32_exn name; comment = None} else Const_pointer name) - | Const_float_array s -> assert false | Const_immstring s -> Const_string {s; unicode = false} | Const_block (t, xs) -> ( let tag = Lambda.tag_of_tag_info t in diff --git a/compiler/core/lam_convert.ml b/compiler/core/lam_convert.ml index 7c877cefb1..dae5b351d9 100644 --- a/compiler/core/lam_convert.ml +++ b/compiler/core/lam_convert.ml @@ -229,7 +229,6 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t = | Pfield (id, info) -> prim ~primitive:(Pfield (id, info)) ~args loc | Psetfield (id, info) -> prim ~primitive:(Psetfield (id, info)) ~args loc | Pduprecord -> prim ~primitive:Pduprecord ~args loc - | Plazyforce -> prim ~primitive:Plazyforce ~args loc | Praise _ -> prim ~primitive:Praise ~args loc | Pobjcomp x -> prim ~primitive:(Pobjcomp x) ~args loc | Pobjorder -> prim ~primitive:Pobjorder ~args loc @@ -248,8 +247,8 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t = | Paddint -> prim ~primitive:Paddint ~args loc | Psubint -> prim ~primitive:Psubint ~args loc | Pmulint -> prim ~primitive:Pmulint ~args loc - | Pdivint _is_safe (*FIXME*) -> prim ~primitive:Pdivint ~args loc - | Pmodint _is_safe (*FIXME*) -> prim ~primitive:Pmodint ~args loc + | Pdivint -> prim ~primitive:Pdivint ~args loc + | Pmodint -> prim ~primitive:Pmodint ~args loc | Pandint -> prim ~primitive:Pandint ~args loc | Porint -> prim ~primitive:Porint ~args loc | Pxorint -> prim ~primitive:Pxorint ~args loc @@ -334,11 +333,6 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t = | Pjs_fn_make arity -> prim ~primitive:(Pjs_fn_make arity) ~args loc | Pjs_fn_make_unit -> prim ~primitive:Pjs_fn_make_unit ~args loc | Pjs_fn_method -> prim ~primitive:Pjs_fn_method ~args loc - | Pjs_unsafe_downgrade -> - let primitive : Lam_primitive.t = - Pjs_unsafe_downgrade {name = Ext_string.empty; setter = false} - in - prim ~primitive ~args loc (* Does not exist since we compile array in js backend unlike native backend *) diff --git a/compiler/core/lam_primitive.ml b/compiler/core/lam_primitive.ml index 21cedb23e5..9bd68d2975 100644 --- a/compiler/core/lam_primitive.ml +++ b/compiler/core/lam_primitive.ml @@ -40,8 +40,6 @@ type t = | Psetfield of int * Lam_compat.set_field_dbg_info (* could have field info at least for record *) | Pduprecord - (* Force lazy values *) - | Plazyforce (* External call *) | Pjs_call of { prim_name: string; @@ -222,10 +220,10 @@ let eq_primitive_approx (lhs : t) (rhs : t) = | Pjs_apply | Pjs_runtime_apply | Pval_from_option | Pval_from_option_not_nest | Pundefined_to_opt | Pnull_to_opt | Pnull_undefined_to_opt | Pis_null | Pis_not_none | Psome | Psome_not_nest | Pis_undefined | Pis_null_undefined - | Pimport | Ptypeof | Pfn_arity | Plazyforce | Pis_poly_var_block | Pdebugger - | Pinit_mod | Pupdate_mod | Pduprecord | Pmakearray | Parraylength - | Parrayrefu | Parraysetu | Parrayrefs | Parraysets | Pjs_fn_make_unit - | Pjs_fn_method | Phash | Phash_mixstring | Phash_mixint | Phash_finalmix -> + | Pimport | Ptypeof | Pfn_arity | Pis_poly_var_block | Pdebugger | Pinit_mod + | Pupdate_mod | Pduprecord | Pmakearray | Parraylength | Parrayrefu + | Parraysetu | Parrayrefs | Parraysets | Pjs_fn_make_unit | Pjs_fn_method + | Phash | Phash_mixstring | Phash_mixint | Phash_finalmix -> rhs = lhs | Pcreate_extension a -> ( match rhs with diff --git a/compiler/core/lam_primitive.mli b/compiler/core/lam_primitive.mli index 4f358b525a..164f66a5be 100644 --- a/compiler/core/lam_primitive.mli +++ b/compiler/core/lam_primitive.mli @@ -36,7 +36,6 @@ type t = | Pfield of int * Lambda.field_dbg_info | Psetfield of int * Lambda.set_field_dbg_info | Pduprecord - | Plazyforce | Pjs_call of { (* Location.t * [loc] is passed down *) prim_name: string; diff --git a/compiler/core/lam_print.ml b/compiler/core/lam_print.ml index 17c18d6108..43c99edc88 100644 --- a/compiler/core/lam_print.ml +++ b/compiler/core/lam_print.ml @@ -82,7 +82,6 @@ let primitive ppf (prim : Lam_primitive.t) = let instr = "setfield " in fprintf ppf "%s%i" instr n | Pduprecord -> fprintf ppf "duprecord" - | Plazyforce -> fprintf ppf "force" | Pjs_call {prim_name} -> fprintf ppf "%s[js]" prim_name | Pjs_object_create _ -> fprintf ppf "[js.obj]" | Praise -> fprintf ppf "raise" diff --git a/compiler/ml/datarepr.ml b/compiler/ml/datarepr.ml index 9e37269deb..b1c69741cf 100644 --- a/compiler/ml/datarepr.ml +++ b/compiler/ml/datarepr.ml @@ -101,11 +101,10 @@ let constructor_has_optional_shape let constructor_descrs ty_path decl cstrs = let ty_res = newgenconstr ty_path decl.type_params in - let num_consts = ref 0 and num_nonconsts = ref 0 and num_normal = ref 0 in + let num_consts = ref 0 and num_nonconsts = ref 0 in List.iter - (fun {cd_args; cd_res; _} -> - if cd_args = Cstr_tuple [] then incr num_consts else incr num_nonconsts; - if cd_res = None then incr num_normal) + (fun {cd_args; _} -> + if cd_args = Cstr_tuple [] then incr num_consts else incr num_nonconsts) cstrs; let rec describe_constructors idx_const idx_nonconst = function | [] -> [] @@ -154,7 +153,6 @@ let constructor_descrs ty_path decl cstrs = cstr_tag = tag; cstr_consts = !num_consts; cstr_nonconsts = !num_nonconsts; - cstr_normal = !num_normal; cstr_private = decl.type_private; cstr_generalized = cd_res <> None; cstr_loc = cd_loc; @@ -208,7 +206,6 @@ let extension_descr path_ext ext = cstr_consts = -1; cstr_nonconsts = -1; cstr_private = ext.ext_private; - cstr_normal = -1; cstr_generalized = ext.ext_ret_type <> None; cstr_loc = ext.ext_loc; cstr_attributes = ext.ext_attributes; diff --git a/compiler/ml/env.ml b/compiler/ml/env.ml index 1547d3450b..a40a83bed0 100644 --- a/compiler/ml/env.ml +++ b/compiler/ml/env.ml @@ -57,7 +57,6 @@ let prefixed_sg = Hashtbl.create 113 type error = | Illegal_renaming of string * string * string | Inconsistent_import of string * string * string - | Need_recursive_types of string * string | Missing_module of Location.t * Path.t * Path.t | Illegal_value_name of Location.t * string @@ -147,8 +146,6 @@ type summary = | Env_extension of summary * Ident.t * extension_constructor | Env_module of summary * Ident.t * module_declaration | Env_modtype of summary * Ident.t * modtype_declaration - | Env_class of unit - | Env_cltype of unit | Env_open of summary * Path.t | Env_functor_arg of summary * Ident.t | Env_constraints of summary * type_declaration PathMap.t @@ -732,8 +729,6 @@ let check_pers_struct name = " %a@ contains the compiled interface for @ %s when %s was expected" Location.print_filename filename ps_name name | Inconsistent_import _ -> assert false - | Need_recursive_types (name, _) -> - Format.sprintf "%s uses recursive types" name | Missing_module _ -> assert false | Illegal_value_name _ -> assert false in @@ -2129,10 +2124,6 @@ let report_error ppf = function "@[The files %a@ and %a@ make inconsistent assumptions@ over \ interface %s@]" Location.print_filename source1 Location.print_filename source2 name - | Need_recursive_types (import, export) -> - fprintf ppf - "@[Unit %s imports from %s, which uses recursive types.@ %s@]" export - import "The compilation flag -rectypes is required" | Missing_module (_, path1, path2) -> fprintf ppf "@[@["; if Path.same path1 path2 then diff --git a/compiler/ml/env.mli b/compiler/ml/env.mli index 8c178452c5..c36a0aa052 100644 --- a/compiler/ml/env.mli +++ b/compiler/ml/env.mli @@ -27,8 +27,6 @@ type summary = | Env_extension of summary * Ident.t * extension_constructor | Env_module of summary * Ident.t * module_declaration | Env_modtype of summary * Ident.t * modtype_declaration - | Env_class of unit - | Env_cltype of unit | Env_open of summary * Path.t | Env_functor_arg of summary * Ident.t | Env_constraints of summary * type_declaration PathMap.t @@ -239,7 +237,6 @@ val env_of_only_summary : (summary -> Subst.t -> t) -> t -> t type error = | Illegal_renaming of string * string * string | Inconsistent_import of string * string * string - | Need_recursive_types of string * string | Missing_module of Location.t * Path.t * Path.t | Illegal_value_name of Location.t * string diff --git a/compiler/ml/error_message_utils.ml b/compiler/ml/error_message_utils.ml index 1fa8fe7256..c80295c248 100644 --- a/compiler/ml/error_message_utils.ml +++ b/compiler/ml/error_message_utils.ml @@ -5,7 +5,6 @@ type type_clash_statement = FunctionCall type type_clash_context = | SetRecordField | ArrayValue - | FunctionReturn | MaybeUnwrapOption | IfCondition | IfReturn @@ -53,8 +52,6 @@ let error_expected_type_text ppf type_clash_context = fprintf ppf "But it's being used with the @{%s@} operator, which works on:" operator - | Some FunctionReturn -> - fprintf ppf "But this function is expecting you to return:" | Some StringConcat -> fprintf ppf "But string concatenation is expecting:" | _ -> fprintf ppf "But it's expected to have type:" diff --git a/compiler/ml/lambda.ml b/compiler/ml/lambda.ml index 89e7f6f477..809c1164a7 100644 --- a/compiler/ml/lambda.ml +++ b/compiler/ml/lambda.ml @@ -125,7 +125,6 @@ type field_dbg_info = | Fld_extension | Fld_variant | Fld_cons - | Fld_array let fld_record (lbl : label) = Fld_record @@ -164,8 +163,6 @@ let fld_record_extension_set (lbl : label) = type immediate_or_pointer = Immediate | Pointer -type is_safe = Safe | Unsafe - type primitive = | Pidentity | Pignore @@ -183,8 +180,6 @@ type primitive = | Pfield of int * field_dbg_info | Psetfield of int * set_field_dbg_info | Pduprecord - (* Force lazy values *) - | Plazyforce (* External call *) | Pccall of Primitive.description (* Exceptions *) @@ -209,8 +204,8 @@ type primitive = | Paddint | Psubint | Pmulint - | Pdivint of is_safe - | Pmodint of is_safe + | Pdivint + | Pmodint | Pandint | Porint | Pxorint @@ -310,13 +305,12 @@ type primitive = | Pjs_fn_make of int | Pjs_fn_make_unit | Pjs_fn_method - | Pjs_unsafe_downgrade and comparison = Ceq | Cneq | Clt | Cgt | Cle | Cge and value_kind = Pgenval -and raise_kind = Raise_regular | Raise_reraise | Raise_notrace +and raise_kind = Raise_regular | Raise_reraise type pointer_info = | Pt_constructor of { @@ -334,7 +328,6 @@ type structured_constant = | Const_base of Asttypes.constant | Const_pointer of int * pointer_info | Const_block of tag_info * structured_constant list - | Const_float_array of string list | Const_immstring of string | Const_false | Const_true @@ -507,16 +500,6 @@ let name_lambda strict arg fn = let id = Ident.create "let" in Llet (strict, Pgenval, id, arg, fn id) -let name_lambda_list args fn = - let rec name_list names = function - | [] -> fn (List.rev names) - | (Lvar _ as arg) :: rem -> name_list (arg :: names) rem - | arg :: rem -> - let id = Ident.create "let" in - Llet (Strict, Pgenval, id, arg, name_list (Lvar id :: names) rem) - in - name_list [] args - let iter_opt f = function | None -> () | Some e -> f e @@ -650,16 +633,6 @@ let transl_value_path ?(loc = Location.none) env path = let transl_extension_path = transl_value_path -(* compatibility alias, deprecated in the .mli *) -(* Compile a sequence of expressions *) - -let rec make_sequence fn = function - | [] -> lambda_unit - | [x] -> fn x - | x :: rem -> - let lam = fn x in - Lsequence (lam, make_sequence fn rem) - (* Apply a substitution to a lambda-term. Assumes that the bound variables of the lambda-term do not belong to the domain of the substitution. @@ -713,56 +686,6 @@ let subst_lambda s lam = in subst lam -let rec map f lam = - let lam = - match lam with - | Lvar _ -> lam - | Lconst _ -> lam - | Lapply {ap_func; ap_args; ap_loc; ap_inlined} -> - Lapply - { - ap_func = map f ap_func; - ap_args = List.map (map f) ap_args; - ap_loc; - ap_inlined; - } - | Lfunction {params; body; attr; loc} -> - Lfunction {params; body = map f body; attr; loc} - | Llet (str, k, v, e1, e2) -> Llet (str, k, v, map f e1, map f e2) - | Lletrec (idel, e2) -> - Lletrec (List.map (fun (v, e) -> (v, map f e)) idel, map f e2) - | Lprim (p, el, loc) -> Lprim (p, List.map (map f) el, loc) - | Lswitch (e, sw, loc) -> - Lswitch - ( map f e, - { - sw_numconsts = sw.sw_numconsts; - sw_consts = List.map (fun (n, e) -> (n, map f e)) sw.sw_consts; - sw_numblocks = sw.sw_numblocks; - sw_blocks = List.map (fun (n, e) -> (n, map f e)) sw.sw_blocks; - sw_failaction = Misc.may_map (map f) sw.sw_failaction; - sw_names = sw.sw_names; - }, - loc ) - | Lstringswitch (e, sw, default, loc) -> - Lstringswitch - ( map f e, - List.map (fun (s, e) -> (s, map f e)) sw, - Misc.may_map (map f) default, - loc ) - | Lstaticraise (i, args) -> Lstaticraise (i, List.map (map f) args) - | Lstaticcatch (body, id, handler) -> - Lstaticcatch (map f body, id, map f handler) - | Ltrywith (e1, v, e2) -> Ltrywith (map f e1, v, map f e2) - | Lifthenelse (e1, e2, e3) -> Lifthenelse (map f e1, map f e2, map f e3) - | Lsequence (e1, e2) -> Lsequence (map f e1, map f e2) - | Lwhile (e1, e2) -> Lwhile (map f e1, map f e2) - | Lfor (v, e1, e2, dir, e3) -> Lfor (v, map f e1, map f e2, dir, map f e3) - | Lassign (v, e) -> Lassign (v, map f e) - | Lsend (k, o, loc) -> Lsend (k, map f o, loc) - in - f lam - (* To let-bind expressions to variables *) let bind str var exp body = @@ -770,26 +693,9 @@ let bind str var exp body = | Lvar var' when Ident.same var var' -> body | _ -> Llet (str, Pgenval, var, exp, body) -and commute_comparison = function - | Ceq -> Ceq - | Cneq -> Cneq - | Clt -> Cgt - | Cle -> Cge - | Cgt -> Clt - | Cge -> Cle - -and negate_comparison = function - | Ceq -> Cneq - | Cneq -> Ceq - | Clt -> Cge - | Cle -> Cgt - | Cgt -> Cle - | Cge -> Clt - let raise_kind = function | Raise_regular -> "raise" | Raise_reraise -> "reraise" - | Raise_notrace -> "raise_notrace" let lam_of_loc kind loc = let loc_start = loc.Location.loc_start in @@ -821,5 +727,3 @@ let lam_of_loc kind loc = in Lconst (Const_immstring loc) | Loc_LINE -> Lconst (Const_base (Const_int lnum)) - -let reset () = raise_count := 0 diff --git a/compiler/ml/lambda.mli b/compiler/ml/lambda.mli index cf163b461d..aecdec146f 100644 --- a/compiler/ml/lambda.mli +++ b/compiler/ml/lambda.mli @@ -94,7 +94,6 @@ type field_dbg_info = | Fld_extension | Fld_variant | Fld_cons - | Fld_array val fld_record : Types.label_description -> field_dbg_info @@ -118,7 +117,6 @@ val fld_record_inline_set : Types.label_description -> set_field_dbg_info val fld_record_extension_set : Types.label_description -> set_field_dbg_info type immediate_or_pointer = Immediate | Pointer -type is_safe = Safe | Unsafe type pointer_info = | Pt_constructor of { @@ -149,8 +147,6 @@ type primitive = | Pfield of int * field_dbg_info | Psetfield of int * set_field_dbg_info | Pduprecord - (* Force lazy values *) - | Plazyforce (* External call *) | Pccall of Primitive.description (* Exceptions *) @@ -175,8 +171,8 @@ type primitive = | Paddint | Psubint | Pmulint - | Pdivint of is_safe - | Pmodint of is_safe + | Pdivint + | Pmodint | Pandint | Porint | Pxorint @@ -276,19 +272,17 @@ type primitive = | Pjs_fn_make of int | Pjs_fn_make_unit | Pjs_fn_method - | Pjs_unsafe_downgrade and comparison = Ceq | Cneq | Clt | Cgt | Cle | Cge and value_kind = Pgenval -and raise_kind = Raise_regular | Raise_reraise | Raise_notrace +and raise_kind = Raise_regular | Raise_reraise type structured_constant = | Const_base of constant | Const_pointer of int * pointer_info | Const_block of tag_info * structured_constant list - | Const_float_array of string list | Const_immstring of string | Const_false | Const_true @@ -386,7 +380,6 @@ val lambda_assert_false : lambda val lambda_unit : lambda val lambda_module_alias : lambda val name_lambda : let_kind -> lambda -> (Ident.t -> lambda) -> lambda -val name_lambda_list : lambda list -> (lambda list -> lambda) -> lambda val iter : (lambda -> unit) -> lambda -> unit module IdentSet : Set.S with type elt = Ident.t @@ -398,15 +391,9 @@ val transl_module_path : ?loc:Location.t -> Env.t -> Path.t -> lambda val transl_value_path : ?loc:Location.t -> Env.t -> Path.t -> lambda val transl_extension_path : ?loc:Location.t -> Env.t -> Path.t -> lambda -val make_sequence : ('a -> lambda) -> 'a list -> lambda - val subst_lambda : lambda Ident.tbl -> lambda -> lambda -val map : (lambda -> lambda) -> lambda -> lambda val bind : let_kind -> Ident.t -> lambda -> lambda -> lambda -val commute_comparison : comparison -> comparison -val negate_comparison : comparison -> comparison - val default_function_attribute : function_attribute (***********************) @@ -429,5 +416,3 @@ val patch_guarded : lambda -> lambda -> lambda val raise_kind : raise_kind -> string val lam_of_loc : loc_kind -> Location.t -> lambda - -val reset : unit -> unit diff --git a/compiler/ml/primitive.ml b/compiler/ml/primitive.ml index f776eb29df..602cb22089 100644 --- a/compiler/ml/primitive.ml +++ b/compiler/ml/primitive.ml @@ -18,8 +18,6 @@ open Misc open Parsetree -type boxed_integer = Pbigint | Pint32 | Pint64 - type description = { prim_name: string; (* Name of primitive or C function *) prim_arity: int; (* Number of arguments *) @@ -32,24 +30,6 @@ type description = { let coerce : (description -> description -> bool) ref = ref (fun (p1 : description) (p2 : description) -> p1 = p2) -let simple ~name ~arity ~alloc = - { - prim_name = name; - prim_arity = arity; - prim_alloc = alloc; - prim_native_name = ""; - prim_from_constructor = false; - } - -let make ~name ~alloc ~native_name ~arity = - { - prim_name = name; - prim_arity = arity; - prim_alloc = alloc; - prim_native_name = native_name; - prim_from_constructor = false; - } - let parse_declaration valdecl ~arity ~from_constructor = let name, native_name = match valdecl.pval_prim with @@ -73,8 +53,3 @@ let print p osig_val_decl = else [p.prim_name] in {osig_val_decl with oval_prims = prims; oval_attributes = []} - -let native_name p = - if p.prim_native_name <> "" then p.prim_native_name else p.prim_name - -let byte_name p = p.prim_name diff --git a/compiler/ml/primitive.mli b/compiler/ml/primitive.mli index dbd4cc310c..9166ae1a5c 100644 --- a/compiler/ml/primitive.mli +++ b/compiler/ml/primitive.mli @@ -15,8 +15,6 @@ (* Description of primitive functions *) -type boxed_integer = Pbigint | Pint32 | Pint64 - type description = private { prim_name: string; (* Name of primitive or C function *) prim_arity: int; (* Number of arguments *) @@ -28,11 +26,6 @@ type description = private { (* Invariant [List.length d.prim_native_repr_args = d.prim_arity] *) -val simple : name:string -> arity:int -> alloc:bool -> description - -val make : - name:string -> alloc:bool -> native_name:string -> arity:int -> description - val parse_declaration : Parsetree.value_description -> arity:int -> @@ -41,7 +34,4 @@ val parse_declaration : val print : description -> Outcometree.out_val_decl -> Outcometree.out_val_decl -val native_name : description -> string -val byte_name : description -> string - val coerce : (description -> description -> bool) ref diff --git a/compiler/ml/printlambda.ml b/compiler/ml/printlambda.ml index 6d4d0cebfe..682e05660a 100644 --- a/compiler/ml/printlambda.ml +++ b/compiler/ml/printlambda.ml @@ -39,10 +39,6 @@ let rec struct_const ppf = function List.iter (fun sc -> fprintf ppf "@ %a" struct_const sc) scl in fprintf ppf "@[<1>[%i:@ @[%a%a@]]@]" tag struct_const sc1 sconsts scl - | Const_float_array [] -> fprintf ppf "[| |]" - | Const_float_array (f1 :: fl) -> - let floats ppf fl = List.iter (fun f -> fprintf ppf "@ %s" f) fl in - fprintf ppf "@[<1>[|@[%s%a@]|]@]" f1 floats fl | Const_false -> fprintf ppf "false" | Const_true -> fprintf ppf "true" @@ -87,7 +83,6 @@ let str_of_field_info (fld_info : Lambda.field_dbg_info) = | Fld_extension -> "ext" | Fld_variant -> "var" | Fld_cons -> "cons" - | Fld_array -> "[||]" let print_taginfo ppf = function | Blk_extension -> fprintf ppf "ext" | Blk_record_ext {fields = ss} -> @@ -122,7 +117,6 @@ let primitive ppf = function | Pfield (n, fld) -> fprintf ppf "field:%s/%i" (str_of_field_info fld) n | Psetfield (n, _) -> fprintf ppf "setfield %i" n | Pduprecord -> fprintf ppf "duprecord" - | Plazyforce -> fprintf ppf "force" | Pccall p -> fprintf ppf "%s" p.prim_name | Praise k -> fprintf ppf "%s" (Lambda.raise_kind k) | Pobjcomp Ceq -> fprintf ppf "==" @@ -152,10 +146,8 @@ let primitive ppf = function | Paddint -> fprintf ppf "+" | Psubint -> fprintf ppf "-" | Pmulint -> fprintf ppf "*" - | Pdivint Safe -> fprintf ppf "/" - | Pdivint Unsafe -> fprintf ppf "/u" - | Pmodint Safe -> fprintf ppf "mod" - | Pmodint Unsafe -> fprintf ppf "mod_unsafe" + | Pdivint -> fprintf ppf "/" + | Pmodint -> fprintf ppf "mod" | Pandint -> fprintf ppf "and" | Porint -> fprintf ppf "or" | Pxorint -> fprintf ppf "xor" @@ -268,7 +260,6 @@ let primitive ppf = function | Pjs_fn_make arity -> fprintf ppf "#fn_mk(%d)" arity | Pjs_fn_make_unit -> fprintf ppf "#fn_mk_unit" | Pjs_fn_method -> fprintf ppf "#fn_method" - | Pjs_unsafe_downgrade -> fprintf ppf "#unsafe_downgrade" let function_attribute ppf {inline; is_a_functor; return_unit} = if is_a_functor then fprintf ppf "is_a_functor@ "; diff --git a/compiler/ml/subst.ml b/compiler/ml/subst.ml index 0b99cf7949..b439b52f11 100644 --- a/compiler/ml/subst.ml +++ b/compiler/ml/subst.ml @@ -389,26 +389,3 @@ and modtype_declaration s decl = (* For every binding k |-> d of m1, add k |-> f d to m2 and return resulting merged map. *) - -let merge_tbls f m1 m2 = Tbl.fold (fun k d accu -> Tbl.add k (f d) accu) m1 m2 - -let merge_path_maps f m1 m2 = - PathMap.fold (fun k d accu -> PathMap.add k (f d) accu) m1 m2 - -let type_replacement s = function - | Path p -> Path (type_path s p) - | Type_function {params; body} -> - let params = List.map (typexp s) params in - let body = typexp s body in - Type_function {params; body} - -(* Composition of substitutions: - apply (compose s1 s2) x = apply s2 (apply s1 x) *) - -let compose s1 s2 = - { - types = merge_path_maps (type_replacement s2) s1.types s2.types; - modules = merge_path_maps (module_path s2) s1.modules s2.modules; - modtypes = merge_tbls (modtype s2) s1.modtypes s2.modtypes; - for_saving = s1.for_saving || s2.for_saving; - } diff --git a/compiler/ml/subst.mli b/compiler/ml/subst.mli index 10438bfcb1..62ed5d51ab 100644 --- a/compiler/ml/subst.mli +++ b/compiler/ml/subst.mli @@ -57,10 +57,6 @@ val modtype_declaration : t -> modtype_declaration -> modtype_declaration val module_declaration : t -> module_declaration -> module_declaration val typexp : t -> Types.type_expr -> Types.type_expr -(* Composition of substitutions: - apply (compose s1 s2) x = apply s2 (apply s1 x) *) -val compose : t -> t -> t - (* A forward reference to be filled in ctype.ml. *) val ctype_apply_env_empty : (type_expr list -> type_expr -> type_expr list -> type_expr) ref diff --git a/compiler/ml/switch.ml b/compiler/ml/switch.ml index 6236310e49..9626f060c5 100644 --- a/compiler/ml/switch.ml +++ b/compiler/ml/switch.ml @@ -16,7 +16,6 @@ type 'a shared = Shared of 'a | Single of 'a type 'a t_store = { - act_get: unit -> 'a array; act_get_shared: unit -> 'a shared array; act_store: 'a -> int; act_store_shared: 'a -> int; @@ -65,7 +64,6 @@ module Store (A : Stored) = struct st.map <- AMap.add key (mustshare, i) st.map; i) | None -> add mustshare act - and get () = Array.of_list (List.rev_map (fun (_, act) -> act) st.acts) and get_shared () = let acts = Array.of_list @@ -85,7 +83,6 @@ module Store (A : Stored) = struct { act_store = store false; act_store_shared = store true; - act_get = get; act_get_shared = get_shared; } end diff --git a/compiler/ml/switch.mli b/compiler/ml/switch.mli index 8edf18a963..89bce4107d 100644 --- a/compiler/ml/switch.mli +++ b/compiler/ml/switch.mli @@ -32,7 +32,6 @@ type 'a shared = Shared of 'a | Single of 'a type 'a t_store = { - act_get: unit -> 'a array; act_get_shared: unit -> 'a shared array; act_store: 'a -> int; act_store_shared: 'a -> int; diff --git a/compiler/ml/translcore.ml b/compiler/ml/translcore.ml index 12f30a0533..03782b95fa 100644 --- a/compiler/ml/translcore.ml +++ b/compiler/ml/translcore.ml @@ -274,8 +274,8 @@ let primitives_table = ("%addint", Paddint); ("%subint", Psubint); ("%mulint", Pmulint); - ("%divint", Pdivint Safe); - ("%modint", Pmodint Safe); + ("%divint", Pdivint); + ("%modint", Pmodint); ("%andint", Pandint); ("%orint", Porint); ("%xorint", Pxorint); @@ -447,15 +447,6 @@ let transl_primitive loc p env ty = with Not_found -> Pccall p in match prim with - | Plazyforce -> - let parm = Ident.create "prim" in - Lfunction - { - params = [parm]; - body = Matching.inline_lazy_force (Lvar parm) Location.none; - loc; - attr = default_function_attribute; - } | Ploc kind -> ( let lam = lam_of_loc kind loc in match p.prim_arity with @@ -757,8 +748,6 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda = | Ploc _, _ -> assert false | _, _ -> ( match (prim, argl) with - | Plazyforce, [a] -> wrap (Matching.inline_lazy_force a e.exp_loc) - | Plazyforce, _ -> assert false | _ -> wrap (Lprim (prim, argl, e.exp_loc)))) | Texp_apply {funct; args = oargs; partial} -> let inlined, funct = diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 2217d3c94d..ffbfc0ac42 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -69,7 +69,6 @@ type error = | Exception_pattern_below_toplevel | Inlined_record_escape | Inlined_record_expected - | Unrefuted_pattern of pattern | Invalid_extension_constructor_payload | Not_an_extension_constructor | Literal_overflow of string @@ -1997,19 +1996,6 @@ let generalizable level ty = false (* Helpers for packaged modules. *) -let create_package_type loc env (p, l) = - let s = !Typetexp.transl_modtype_longident loc env p in - let fields = - List.map - (fun (name, ct) -> (name, Typetexp.transl_simple_type env false ct)) - l - in - let ty = - newty - (Tpackage - (s, List.map fst l, List.map (fun (_, cty) -> cty.ctyp_type) fields)) - in - (s, fields, ty) let wrap_unpacks sexp unpacks = let open Ast_helper in @@ -4154,12 +4140,6 @@ let type_binding env rec_flag spat_sexp_list scope = in (pat_exp_list, new_env) -let type_let env rec_flag spat_sexp_list scope = - let pat_exp_list, new_env, _unpacks = - type_let env rec_flag spat_sexp_list scope false - in - (pat_exp_list, new_env) - (* Typing of toplevel expressions *) let type_expression env sexp = @@ -4436,10 +4416,6 @@ let report_error env ppf error = escape.@]" | Inlined_record_expected -> fprintf ppf "@[This constructor expects an inlined record argument.@]" - | Unrefuted_pattern pat -> - fprintf ppf "@[%s@ %s@ %a@]" "This match case could not be refuted." - "Here is an example of a value that would reach it:" Parmatch.top_pretty - pat | Invalid_extension_constructor_payload -> fprintf ppf "Invalid [%%extension_constructor] payload, a constructor is expected." @@ -4477,8 +4453,6 @@ let report_error env ppf error = fprintf ppf "Direct field access on a dict is not supported. Use Dict.get instead." -let super_report_error_no_wrap_printing_env = report_error - let report_error env ppf err = Printtyp.wrap_printing_env env (fun () -> report_error env ppf err) @@ -4489,7 +4463,4 @@ let () = | Error_forward err -> Some err | _ -> None) -(* drop ?recarg argument from the external API *) -let type_expect ?in_function env e ty = type_expect ?in_function env e ty let type_exp env e = type_exp env e -let type_argument env e t1 t2 = type_argument env e t1 t2 diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index 1a8bbed4c7..3aa23756d4 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -27,12 +27,6 @@ val type_binding : Parsetree.value_binding list -> Annot.ident option -> Typedtree.value_binding list * Env.t -val type_let : - Env.t -> - rec_flag -> - Parsetree.value_binding list -> - Annot.ident option -> - Typedtree.value_binding list * Env.t val type_expression : Env.t -> Parsetree.expression -> Typedtree.expression val check_partial : ?lev:int -> @@ -41,20 +35,8 @@ val check_partial : Location.t -> Typedtree.case list -> Typedtree.partial -val type_expect : - ?in_function:Location.t * type_expr -> - Env.t -> - Parsetree.expression -> - type_expr -> - Typedtree.expression val type_exp : Env.t -> Parsetree.expression -> Typedtree.expression val type_approx : Env.t -> Parsetree.expression -> type_expr -val type_argument : - Env.t -> - Parsetree.expression -> - type_expr -> - type_expr -> - Typedtree.expression val option_some : Typedtree.expression -> Typedtree.expression val option_none : type_expr -> Location.t -> Typedtree.expression @@ -112,7 +94,6 @@ type error = | Exception_pattern_below_toplevel | Inlined_record_escape | Inlined_record_expected - | Unrefuted_pattern of Typedtree.pattern | Invalid_extension_constructor_payload | Not_an_extension_constructor | Literal_overflow of string @@ -126,9 +107,6 @@ type error = exception Error of Location.t * Env.t * error exception Error_forward of Location.error -val super_report_error_no_wrap_printing_env : - Env.t -> formatter -> error -> unit - val report_error : Env.t -> formatter -> error -> unit (* Deprecated. Use Location.{error_of_exn, report_error}. *) @@ -154,10 +132,4 @@ val type_package : Typedtree.module_expr * type_expr list) ref -val create_package_type : - Location.t -> - Env.t -> - Longident.t * (Longident.t * Parsetree.core_type) list -> - Path.t * (Longident.t * Typedtree.core_type) list * Types.type_expr - val constant : Parsetree.constant -> (Asttypes.constant, error) result diff --git a/compiler/ml/typemod.ml b/compiler/ml/typemod.ml index be6ac27e51..e012a636cc 100644 --- a/compiler/ml/typemod.ml +++ b/compiler/ml/typemod.ml @@ -1790,12 +1790,6 @@ let type_implementation_more ?check_exists sourcefile outputprefix modulename (Some sourcefile) initial_env None; raise e -let type_implementation sourcefile outputprefix modulename initial_env ast = - let a, b, _, _ = - type_implementation_more sourcefile outputprefix modulename initial_env ast - in - (a, b) - let save_signature modname tsg outputprefix source_file initial_env cmi = Cmt_format.save_cmt (outputprefix ^ ".cmti") modname (Cmt_format.Interface tsg) (Some source_file) initial_env (Some cmi) @@ -1900,8 +1894,6 @@ let report_error ppf = function | Cannot_scrape_alias p -> fprintf ppf "This is an alias for module %a, which is missing" path p -let super_report_error_no_wrap_printing_env = report_error - let report_error env ppf err = Printtyp.wrap_printing_env env (fun () -> report_error ppf err) diff --git a/compiler/ml/typemod.mli b/compiler/ml/typemod.mli index 8bef382fbe..0f36cf6afd 100644 --- a/compiler/ml/typemod.mli +++ b/compiler/ml/typemod.mli @@ -38,14 +38,6 @@ val type_implementation_more : Parsetree.structure -> Typedtree.structure * Typedtree.module_coercion * Env.t * Types.signature -val type_implementation : - string -> - string -> - string -> - Env.t -> - Parsetree.structure -> - Typedtree.structure * Typedtree.module_coercion - val transl_signature : Env.t -> Parsetree.signature -> Typedtree.signature val check_nongen_schemes : Env.t -> Types.signature -> unit val type_open_ : @@ -96,6 +88,4 @@ type error = exception Error of Location.t * Env.t * error exception Error_forward of Location.error -val super_report_error_no_wrap_printing_env : formatter -> error -> unit - val report_error : Env.t -> formatter -> error -> unit diff --git a/compiler/ml/typeopt.ml b/compiler/ml/typeopt.ml index 350269558a..c661b5b635 100644 --- a/compiler/ml/typeopt.ml +++ b/compiler/ml/typeopt.ml @@ -108,8 +108,6 @@ let is_base_type env ty base_ty_path = let maybe_pointer_type env ty = if Ctype.maybe_pointer_type env ty then Pointer else Immediate -let maybe_pointer exp = maybe_pointer_type exp.exp_env exp.exp_type - type classification = | Int | Float diff --git a/compiler/ml/typeopt.mli b/compiler/ml/typeopt.mli index eb4a795a6d..38b667c273 100644 --- a/compiler/ml/typeopt.mli +++ b/compiler/ml/typeopt.mli @@ -20,7 +20,6 @@ val is_function_type : val is_base_type : Env.t -> Types.type_expr -> Path.t -> bool val maybe_pointer_type : Env.t -> Types.type_expr -> Lambda.immediate_or_pointer -val maybe_pointer : Typedtree.expression -> Lambda.immediate_or_pointer val classify_lazy_argument : Typedtree.expression -> diff --git a/compiler/ml/types.ml b/compiler/ml/types.ml index d931fc1ec9..1886f2a727 100644 --- a/compiler/ml/types.ml +++ b/compiler/ml/types.ml @@ -198,11 +198,6 @@ type extension_constructor = { ext_is_exception: bool; } -and type_transparence = - | Type_public (* unrestricted expansion *) - | Type_new (* "new" type *) - | Type_private (* private type *) - (* Type expressions for the class language *) module Concr = Set.Make (OrderedString) @@ -262,7 +257,6 @@ type constructor_description = { cstr_tag: constructor_tag; (* Tag for heap blocks *) cstr_consts: int; (* Number of constant constructors *) cstr_nonconsts: int; (* Number of non-const constructors *) - cstr_normal: int; (* Number of non generalized constrs *) cstr_generalized: bool; (* Constrained return type? *) cstr_private: private_flag; (* Read-only constructor? *) cstr_loc: Location.t; diff --git a/compiler/ml/types.mli b/compiler/ml/types.mli index 09f82c8d9e..71c19f629a 100644 --- a/compiler/ml/types.mli +++ b/compiler/ml/types.mli @@ -330,13 +330,6 @@ type extension_constructor = { ext_is_exception: bool; } -and type_transparence = - | Type_public (* unrestricted expansion *) - | Type_new (* "new" type *) - | Type_private (* private type *) - -(* Type expressions for the class language *) - module Concr : Set.S with type elt = string (* Type expressions for the module language *) @@ -394,7 +387,6 @@ type constructor_description = { cstr_tag: constructor_tag; (* Tag for heap blocks *) cstr_consts: int; (* Number of constant constructors *) cstr_nonconsts: int; (* Number of non-const constructors *) - cstr_normal: int; (* Number of non generalized constrs *) cstr_generalized: bool; (* Constrained return type? *) cstr_private: private_flag; (* Read-only constructor? *) cstr_loc: Location.t; diff --git a/compiler/ml/typetexp.ml b/compiler/ml/typetexp.ml index 6e862aa1e6..d212eb2dc6 100644 --- a/compiler/ml/typetexp.ml +++ b/compiler/ml/typetexp.ml @@ -30,9 +30,6 @@ type error = | Unbound_type_constructor of Longident.t | Unbound_type_constructor_2 of Path.t | Type_arity_mismatch of Longident.t * int * int - | Bound_type_variable of string - | Recursive_type - | Unbound_row_variable of Longident.t | Type_mismatch of (type_expr * type_expr) list | Alias_type_mismatch of (type_expr * type_expr) list | Present_has_conjunction of string @@ -131,7 +128,6 @@ let find_constructor = let find_all_constructors = find_component Env.lookup_all_constructors (fun lid -> Unbound_constructor lid) -let find_label = find_component Env.lookup_label (fun lid -> Unbound_label lid) let find_all_labels = find_component Env.lookup_all_labels (fun lid -> Unbound_label lid) @@ -232,11 +228,6 @@ let validate_name = function let new_global_var ?name () = new_global_var ?name:(validate_name name) () let newvar ?name () = newvar ?name:(validate_name name) () -let type_variable loc name = - try Tbl.find name !type_variables - with Not_found -> - raise (Error (loc, Env.empty, Unbound_type_variable ("'" ^ name))) - let transl_type_param env styp = let loc = styp.ptyp_loc in match styp.ptyp_desc with @@ -668,8 +659,6 @@ let make_fixed_univars ty = make_fixed_univars ty; Btype.unmark_type ty -let create_package_mty = create_package_mty false - let globalize_used_variables env fixed = let r = ref [] in Tbl.iter @@ -709,40 +698,6 @@ let transl_simple_type env fixed styp = make_fixed_univars typ.ctyp_type; typ -let transl_simple_type_univars env styp = - univars := []; - used_variables := Tbl.empty; - pre_univars := []; - begin_def (); - let typ = transl_type env Univars styp in - (* Only keep already global variables in used_variables *) - let new_variables = !used_variables in - used_variables := Tbl.empty; - Tbl.iter - (fun name p -> - if Tbl.mem name !type_variables then - used_variables := Tbl.add name p !used_variables) - new_variables; - globalize_used_variables env false (); - end_def (); - generalize typ.ctyp_type; - let univs = - List.fold_left - (fun acc v -> - let v = repr v in - match v.desc with - | Tvar name when v.level = Btype.generic_level -> - v.desc <- Tunivar name; - v :: acc - | _ -> acc) - [] !pre_univars - in - make_fixed_univars typ.ctyp_type; - { - typ with - ctyp_type = instance env (Btype.newgenty (Tpoly (typ.ctyp_type, univs))); - } - let transl_simple_type_delayed env styp = univars := []; used_variables := Tbl.empty; @@ -836,13 +791,6 @@ let report_error env ppf = function "@[The type constructor %a@ expects %i argument(s),@ but is here \ applied to %i argument(s)@]" longident lid expected provided - | Bound_type_variable name -> - fprintf ppf "Already bound type parameter '%s" name - | Recursive_type -> fprintf ppf "This type is recursive" - | Unbound_row_variable lid -> - (* we don't use "spellcheck" here: this error is not raised - anywhere so it's unclear how it should be handled *) - fprintf ppf "Unbound row variable in #%a" longident lid | Type_mismatch trace -> Printtyp.report_unification_error ppf Env.empty trace (function diff --git a/compiler/ml/typetexp.mli b/compiler/ml/typetexp.mli index be9a9302cd..f09c26c58e 100644 --- a/compiler/ml/typetexp.mli +++ b/compiler/ml/typetexp.mli @@ -19,8 +19,6 @@ open Types val transl_simple_type : Env.t -> bool -> Parsetree.core_type -> Typedtree.core_type -val transl_simple_type_univars : - Env.t -> Parsetree.core_type -> Typedtree.core_type val transl_simple_type_delayed : Env.t -> Parsetree.core_type -> Typedtree.core_type * (unit -> unit) (* Translate a type, but leave type variables unbound. Returns @@ -28,7 +26,6 @@ val transl_simple_type_delayed : val transl_type_scheme : Env.t -> Parsetree.core_type -> Typedtree.core_type val reset_type_variables : unit -> unit -val type_variable : Location.t -> string -> type_expr val transl_type_param : Env.t -> Parsetree.core_type -> Typedtree.core_type type variable_context @@ -42,9 +39,6 @@ type error = | Unbound_type_constructor of Longident.t | Unbound_type_constructor_2 of Path.t | Type_arity_mismatch of Longident.t * int * int - | Bound_type_variable of string - | Recursive_type - | Unbound_row_variable of Longident.t | Type_mismatch of (type_expr * type_expr) list | Alias_type_mismatch of (type_expr * type_expr) list | Present_has_conjunction of string @@ -80,11 +74,6 @@ val transl_modtype_longident : val transl_modtype : (* from Typemod *) (Env.t -> Parsetree.module_type -> Typedtree.module_type) ref -val create_package_mty : - Location.t -> - Env.t -> - Parsetree.package_type -> - (Longident.t Asttypes.loc * Parsetree.core_type) list * Parsetree.module_type val find_type : Env.t -> Location.t -> Longident.t -> Path.t * type_declaration val find_constructor : @@ -94,7 +83,6 @@ val find_all_constructors : Location.t -> Longident.t -> (constructor_description * (unit -> unit)) list -val find_label : Env.t -> Location.t -> Longident.t -> label_description val find_all_labels : Env.t -> Location.t -> @@ -110,14 +98,3 @@ val find_modtype : val unbound_constructor_error : Env.t -> Longident.t Location.loc -> 'a val unbound_label_error : Env.t -> Longident.t Location.loc -> 'a - -val spellcheck : - Format.formatter -> - (('a -> 'a list -> 'a list) -> - Longident.t option -> - 'b -> - 'c list -> - string list) -> - 'b -> - Longident.t -> - unit diff --git a/compiler/ml/unified_ops.ml b/compiler/ml/unified_ops.ml index c57c14bce0..980f7bd1f3 100644 --- a/compiler/ml/unified_ops.ml +++ b/compiler/ml/unified_ops.ml @@ -128,7 +128,7 @@ let entries = form = Binary; specialization = { - int = Pdivint Safe; + int = Pdivint; bool = None; float = Some Pdivfloat; bigint = Some Pdivbigint; @@ -141,7 +141,7 @@ let entries = form = Binary; specialization = { - int = Pmodint Safe; + int = Pmodint; bool = None; float = Some Pmodfloat; bigint = Some Pmodbigint; @@ -154,7 +154,7 @@ let entries = form = Binary; specialization = { - int = Pmodint Safe; + int = Pmodint; bool = None; float = Some Pmodfloat; bigint = Some Pmodbigint; diff --git a/compiler/ml/variant_coercion.ml b/compiler/ml/variant_coercion.ml index 06f5f627a7..ecec066c63 100644 --- a/compiler/ml/variant_coercion.ml +++ b/compiler/ml/variant_coercion.ml @@ -21,10 +21,6 @@ let variant_has_catch_all_case constructors |> List.exists has_catch_all_string_case -let variant_has_relevant_primitive_catch_all - (constructors : Types.constructor_declaration list) = - variant_has_catch_all_case constructors can_coerce_primitive - (* Checks if every case of the variant has the same runtime representation as the target type. *) let variant_has_same_runtime_representation_as_target ~(target_path : Path.t) ~unboxed (constructors : Types.constructor_declaration list) =