@@ -72685,6 +72685,7 @@ let try_ids = Hashtbl.create 8
72685
72685
72686
72686
let rec transl_exp e =
72687
72687
List.iter (Translattribute.check_attribute e) e.exp_attributes;
72688
+
72688
72689
let eval_once =
72689
72690
(* Whether classes for immediate objects must be cached *)
72690
72691
match e.exp_desc with
@@ -73008,6 +73009,7 @@ and transl_exp0 e =
73008
73009
| Texp_for(param, _, low, high, dir, body) ->
73009
73010
Lfor(param, transl_exp low, transl_exp high, dir,
73010
73011
event_before body (transl_exp body))
73012
+
73011
73013
| Texp_send(_, _, Some exp) -> transl_exp exp
73012
73014
| Texp_send(expr, met, None) ->
73013
73015
let obj = transl_exp expr in
@@ -73020,6 +73022,7 @@ and transl_exp0 e =
73020
73022
Lsend (kind, tag, obj, cache, e.exp_loc)
73021
73023
in
73022
73024
event_after e lam
73025
+
73023
73026
| Texp_new (cl, {Location.loc=loc}, _) ->
73024
73027
Lapply{ap_should_be_tailcall=false;
73025
73028
ap_loc=loc;
@@ -73033,6 +73036,7 @@ and transl_exp0 e =
73033
73036
| Texp_setinstvar(path_self, path, _, expr) ->
73034
73037
transl_setinstvar e.exp_loc (transl_normal_path path_self) path expr
73035
73038
| Texp_override(path_self, modifs) ->
73039
+
73036
73040
let cpy = Ident.create "copy" in
73037
73041
Llet(Strict, Pgenval, cpy,
73038
73042
Lapply{ap_should_be_tailcall=false;
@@ -73047,6 +73051,7 @@ and transl_exp0 e =
73047
73051
(Lvar cpy) path expr, rem))
73048
73052
modifs
73049
73053
(Lvar cpy))
73054
+
73050
73055
| Texp_letmodule(id, loc, modl, body) ->
73051
73056
let defining_expr =
73052
73057
@@ -80216,7 +80221,7 @@ open Typedtree
80216
80221
open Lambda
80217
80222
open Translobj
80218
80223
open Translcore
80219
- open Translclass
80224
+
80220
80225
80221
80226
type error =
80222
80227
Circular_dependency of Ident.t
@@ -80561,7 +80566,7 @@ let transl_class_bindings cl_list =
80561
80566
(ids,
80562
80567
List.map
80563
80568
(fun ({ci_id_class=id; ci_expr=cl; ci_virt=vf}, meths) ->
80564
- (id, transl_class ids id meths cl vf))
80569
+ (id, Translclass. transl_class ids id meths cl vf))
80565
80570
cl_list)
80566
80571
80567
80572
(* Compile one or more functors, merging curried functors to produce
@@ -80823,13 +80828,15 @@ and transl_structure loc fields cc rootpath final_env = function
80823
80828
body
80824
80829
in
80825
80830
lam, size
80831
+
80826
80832
| Tstr_class cl_list ->
80827
80833
let (ids, class_bindings) = transl_class_bindings cl_list in
80828
80834
let body, size =
80829
80835
transl_structure loc (List.rev_append ids fields)
80830
80836
cc rootpath final_env rem
80831
80837
in
80832
80838
Lletrec(class_bindings, body), size
80839
+
80833
80840
| Tstr_include incl ->
80834
80841
let ids = bound_value_identifiers incl.incl_type in
80835
80842
let modl = incl.incl_mod in
@@ -81163,6 +81170,7 @@ let transl_store_structure glob map prims str =
81163
81170
bindings
81164
81171
(Lsequence(store_idents Location.none ids,
81165
81172
transl_store rootpath (add_idents true ids subst) rem))
81173
+
81166
81174
| Tstr_class cl_list ->
81167
81175
let (ids, class_bindings) = transl_class_bindings cl_list in
81168
81176
let lam =
@@ -81426,12 +81434,14 @@ let transl_toplevel_item item =
81426
81434
(fun id modl _loc -> transl_module Tcoerce_none (Some(Pident id)) modl)
81427
81435
bindings
81428
81436
(make_sequence toploop_setvalue_id idents)
81437
+
81429
81438
| Tstr_class cl_list ->
81430
81439
(* we need to use unique names for the classes because there might
81431
81440
be a value named identically *)
81432
81441
let (ids, class_bindings) = transl_class_bindings cl_list in
81433
81442
List.iter set_toplevel_unique_name ids;
81434
81443
Lletrec(class_bindings, make_sequence toploop_setvalue_id ids)
81444
+
81435
81445
| Tstr_include incl ->
81436
81446
let ids = bound_value_identifiers incl.incl_type in
81437
81447
let modl = incl.incl_mod in
@@ -95427,7 +95437,6 @@ type t =
95427
95437
{
95428
95438
name : string ;
95429
95439
setter : bool;
95430
- loc : Location.t;
95431
95440
}
95432
95441
| Pinit_mod
95433
95442
| Pupdate_mod
@@ -95580,7 +95589,6 @@ type t =
95580
95589
{
95581
95590
name : string ;
95582
95591
setter : bool;
95583
- loc : Location.t;
95584
95592
}
95585
95593
| Pinit_mod
95586
95594
| Pupdate_mod
@@ -95745,7 +95753,7 @@ let eq_primitive_approx ( lhs : t) (rhs : t) =
95745
95753
| Pasrint64 -> rhs = Pasrint64
95746
95754
| Pint64comp ( comparison) -> (match rhs with Pint64comp(comparison1) -> Lam_compat.eq_comparison comparison comparison1 | _ -> false)
95747
95755
| Pctconst compile_time_constant -> (match rhs with Pctconst compile_time_constant1 -> Lam_compat.eq_compile_time_constant compile_time_constant compile_time_constant1 | _ -> false)
95748
- | Pjs_unsafe_downgrade {name; loc=_; setter } -> (match rhs with Pjs_unsafe_downgrade rhs -> name = rhs.name && setter = rhs.setter | _ -> false)
95756
+ | Pjs_unsafe_downgrade {name; setter } -> (match rhs with Pjs_unsafe_downgrade rhs -> name = rhs.name && setter = rhs.setter | _ -> false)
95749
95757
| Pjs_fn_make i -> (match rhs with Pjs_fn_make i1 -> i = i1 | _ -> false)
95750
95758
| Pvoid_run -> rhs = Pvoid_run
95751
95759
| Pfull_apply -> rhs = Pfull_apply
@@ -395027,7 +395035,7 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
395027
395035
395028
395036
| "#fn_mk" -> Pjs_fn_make (Ext_pervasives.nat_of_string_exn p.prim_native_name)
395029
395037
| "#fn_method" -> Pjs_fn_method
395030
- | "#unsafe_downgrade" -> Pjs_unsafe_downgrade {name = Ext_string.empty; loc ; setter = false}
395038
+ | "#unsafe_downgrade" -> Pjs_unsafe_downgrade {name = Ext_string.empty; setter = false}
395031
395039
| _ -> Location.raise_errorf ~loc
395032
395040
"@{<error>Error:@} internal error, using unrecognized primitive %s" s
395033
395041
in
@@ -395142,27 +395150,23 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
395142
395150
Lam.for_ id (convert_aux from_) (convert_aux to_) dir (convert_aux loop)
395143
395151
| Lassign (id, body) ->
395144
395152
Lam.assign id (convert_aux body)
395145
- | Lsend (kind , _,b,ls , _loc) ->
395153
+ | Lsend (Public(Some name) , _, obj, _ , _loc) ->
395146
395154
(* Format.fprintf Format.err_formatter "%a@." Printlambda.lambda b ; *)
395147
- (match convert_aux b with
395148
- | Lprim {primitive = Pjs_unsafe_downgrade {loc} ; args}
395155
+ (match convert_aux obj with
395156
+ | Lprim {primitive = Pjs_unsafe_downgrade _ ; args;loc }
395149
395157
->
395150
- begin match kind, ls with
395151
- | Public (Some name), [] ->
395152
395158
let setter = Ext_string.ends_with name Literals.setter_suffix in
395153
395159
let property =
395154
395160
if setter then
395155
395161
Lam_methname.translate
395156
395162
(String.sub name 0
395157
395163
(String.length name - Literals.setter_suffix_len))
395158
395164
else Lam_methname.translate name in
395159
- prim ~primitive:(Pjs_unsafe_downgrade {name = property;loc; setter})
395160
- ~args loc
395161
- | _ -> assert false
395162
- end
395165
+ prim ~primitive:(Pjs_unsafe_downgrade {name = property; setter})
395166
+ ~args loc
395163
395167
| _ ->
395164
395168
assert false)
395165
-
395169
+ | Lsend _ -> assert false
395166
395170
| Levent _ ->
395167
395171
(* disabled by upstream*)
395168
395172
assert false
0 commit comments