diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ad4ae469..4def5782ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ These are only breaking changes for unformatted code. - Syntax: process uncurried types explicitly in the parser/printer https://github.com/rescript-lang/rescript-compiler/pull/5784 https://github.com/rescript-lang/rescript-compiler/pull/5822 - Syntax: process uncurried function declarations explicitly in the parser/printer https://github.com/rescript-lang/rescript-compiler/pull/5794 - PPX V4: allow uncurried `make` function and treat it like a curried one [#5802](https://github.com/rescript-lang/rescript-compiler/pull/5802) [#5808](https://github.com/rescript-lang/rescript-compiler/pull/5808) [#5812](https://github.com/rescript-lang/rescript-compiler/pull/5812) +- Remove processing of objects expressions, which don't exist in `.res` syntax (`Pexp_object`) https://github.com/rescript-lang/rescript-compiler/pull/5841 # 10.1.0-rc.6 diff --git a/jscomp/frontend/ast_util.ml b/jscomp/frontend/ast_util.ml index 54084653a9..e2170db5fd 100644 --- a/jscomp/frontend/ast_util.ml +++ b/jscomp/frontend/ast_util.ml @@ -22,172 +22,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -open Ast_helper - type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list let js_property loc obj (name : string) = Parsetree.Pexp_send (obj, { loc; txt = name }) -let ocaml_obj_as_js_object loc (mapper : Bs_ast_mapper.mapper) - (self_pat : Parsetree.pattern) (clfs : Parsetree.class_field list) = - (* Attention: we should avoid type variable conflict for each method - Since the method name is unique, there would be no conflict - OCaml does not allow duplicate instance variable and duplicate methods, - but it does allow duplicates between instance variable and method name, - we should enforce such rules - {[ - object [@bs] - val x = 3 - method x = 3 - end - ]} should not compile with a meaningful error message - *) - let generate_val_method_pair loc (mapper : Bs_ast_mapper.mapper) - (val_name : string Asttypes.loc) is_mutable = - let result = Typ.var ~loc val_name.txt in - ( result, - Parsetree.Otag (val_name, [], result) - :: - (if is_mutable then - [ - Otag - ( { val_name with txt = val_name.txt ^ Literals.setter_suffix }, - [], - Ast_typ_uncurry.to_method_type loc mapper Nolabel result - (Ast_literal.type_unit ~loc ()) ); - ] - else []) ) - in - - (* Note mapper is only for API compatible - * TODO: we should check label name to avoid conflict - *) - - (* we need calculate the real object type - and exposed object type, in some cases there are equivalent - - for public object type its [@meth] it does not depend on itself - while for label argument it is [@this] which depends internal object - *) - let ( (internal_label_attr_types : Parsetree.object_field list), - (public_label_attr_types : Parsetree.object_field list) ) = - Ext_list.fold_right clfs ([], []) - (fun - ({ pcf_loc = loc } as x : Parsetree.class_field) - (label_attr_types, public_label_attr_types) - -> - match x.pcf_desc with - | Pcf_method (label, public_flag, Cfk_concrete (Fresh, e)) -> ( - match e.pexp_desc with - | Pexp_poly ({ pexp_desc = Pexp_fun (lbl, _, pat, e) }, None) -> - let method_type = - Ast_typ_uncurry.generate_arg_type x.pcf_loc mapper label.txt - lbl pat e - in - ( Parsetree.Otag (label, [], method_type) :: label_attr_types, - if public_flag = Public then - Parsetree.Otag (label, [], method_type) - :: public_label_attr_types - else public_label_attr_types ) - | Pexp_poly (_, Some _) -> - Location.raise_errorf ~loc - "polymorphic type annotation not supported yet" - | Pexp_poly (_, None) -> - Location.raise_errorf ~loc - "Unsupported syntax, expect syntax like `method x () = x ` " - | _ -> Location.raise_errorf ~loc "Unsupported syntax in js object") - | Pcf_val (label, mutable_flag, Cfk_concrete (Fresh, _)) -> - let _, label_attr = - generate_val_method_pair x.pcf_loc mapper label - (mutable_flag = Mutable) - in - ( Ext_list.append label_attr label_attr_types, - public_label_attr_types ) - | Pcf_val (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not support currently" - | Pcf_val (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtual flag not support currently" - | Pcf_method (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not supported" - | Pcf_method (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtural method not supported" - | Pcf_inherit _ | Pcf_initializer _ | Pcf_attribute _ | Pcf_extension _ - | Pcf_constraint _ -> - Location.raise_errorf ~loc "Only method support currently") - in - let internal_obj_type = - Ast_core_type.make_obj ~loc internal_label_attr_types - in - let public_obj_type = Ast_core_type.make_obj ~loc public_label_attr_types in - let labels, label_types, exprs, _ = - Ext_list.fold_right clfs ([], [], [], false) - (fun (x : Parsetree.class_field) (labels, label_types, exprs, aliased) -> - match x.pcf_desc with - | Pcf_method (label, _public_flag, Cfk_concrete (Fresh, e)) -> ( - match e.pexp_desc with - | Pexp_poly - (({ pexp_desc = Pexp_fun (ll, None, pat, e) } as f), None) -> - let alias_type = - if aliased then None else Some internal_obj_type - in - let label_type = - Ast_typ_uncurry.generate_method_type ?alias_type x.pcf_loc - mapper label.txt ll pat e - in - ( label :: labels, - label_type :: label_types, - { - f with - pexp_desc = - (let f = Ast_pat.is_unit_cont pat ~yes:e ~no:f in - Ast_uncurry_gen.to_method_callback loc mapper Nolabel - self_pat f) - (* the first argument is this*); - } - :: exprs, - true ) - | Pexp_poly (_, Some _) -> - Location.raise_errorf ~loc - "polymorphic type annotation not supported yet" - | Pexp_poly (_, None) -> - Location.raise_errorf ~loc - "Unsupported syntax, expect syntax like `method x () = x ` " - | _ -> Location.raise_errorf ~loc "Unsupported syntax in js object") - | Pcf_val (label, mutable_flag, Cfk_concrete (Fresh, val_exp)) -> - let label_type, _ = - generate_val_method_pair x.pcf_loc mapper label - (mutable_flag = Mutable) - in - ( label :: labels, - label_type :: label_types, - mapper.expr mapper val_exp :: exprs, - aliased ) - | Pcf_val (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not support currently" - | Pcf_val (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtual flag not support currently" - | Pcf_method (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not supported" - | Pcf_method (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtural method not supported" - | Pcf_inherit _ | Pcf_initializer _ | Pcf_attribute _ | Pcf_extension _ - | Pcf_constraint _ -> - Location.raise_errorf ~loc "Only method support currently") - in - let pval_type = - Ext_list.fold_right2 labels label_types public_obj_type - (fun label label_type acc -> - Ast_compatible.label_arrow ~loc:label.Asttypes.loc label.Asttypes.txt - label_type acc) - in - Ast_external_mk.local_extern_cont_to_obj loc - ~pval_prim:(Ast_external_process.pval_prim_of_labels labels) - (fun e -> - Ast_compatible.apply_labels ~loc e - (Ext_list.map2 labels exprs (fun l expr -> (l.txt, expr)))) - ~pval_type - let record_as_js_object loc (self : Bs_ast_mapper.mapper) (label_exprs : label_exprs) : Parsetree.expression_desc = let labels, args, arity = diff --git a/jscomp/frontend/ast_util.mli b/jscomp/frontend/ast_util.mli index da170327c2..93c29f9f98 100644 --- a/jscomp/frontend/ast_util.mli +++ b/jscomp/frontend/ast_util.mli @@ -35,10 +35,3 @@ val record_as_js_object : val js_property : Location.t -> Parsetree.expression -> string -> Parsetree.expression_desc - -val ocaml_obj_as_js_object : - Location.t -> - Bs_ast_mapper.mapper -> - Parsetree.pattern -> - Parsetree.class_field list -> - Parsetree.expression_desc diff --git a/jscomp/frontend/bs_builtin_ppx.ml b/jscomp/frontend/bs_builtin_ppx.ml index ef3104e8e0..4b8f3d28bd 100644 --- a/jscomp/frontend/bs_builtin_ppx.ml +++ b/jscomp/frontend/bs_builtin_ppx.ml @@ -155,22 +155,6 @@ let expr_mapper ~async_context ~in_function_def (self : mapper) pexp_attributes; }) | Pexp_apply (fn, args) -> Ast_exp_apply.app_exp_mapper e self fn args - | Pexp_object { pcstr_self; pcstr_fields } -> - let pexp_attributes = - match Ast_attributes.process_bs e.pexp_attributes with - | true, pexp_attributes -> - Location.prerr_warning e.pexp_loc - (Bs_ffi_warning "Here @bs attribute not needed any more"); - pexp_attributes - | false, e -> e - in - { - e with - pexp_desc = - Ast_util.ocaml_obj_as_js_object e.pexp_loc self pcstr_self - pcstr_fields; - pexp_attributes; - } | Pexp_match ( b, [ diff --git a/jscomp/test/arity_ml.js b/jscomp/test/arity_ml.js deleted file mode 100644 index c7cc1c3ca6..0000000000 --- a/jscomp/test/arity_ml.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var o = { - hi: (function (x, y) { - return x + y | 0; - }) -}; - -exports.o = o; -/* o Not a pure module */ diff --git a/jscomp/test/arity_ml.ml b/jscomp/test/arity_ml.ml deleted file mode 100644 index 95135c23f9..0000000000 --- a/jscomp/test/arity_ml.ml +++ /dev/null @@ -1,36 +0,0 @@ -[@@@warning "A-61-42-40"] -let o = object - method hi x y = x + y -end -(* Error (warning 61): This primitive declaration uses type Js_OO.Callback.arity3, which is unannotated and -unboxable. The representation of such types may change in future -versions. You should annotate the declaration of Js_OO.Callback.arity3 with [@@boxed] -or [@@unboxed]. *) - -(* let h o = - (o 1 2 :unit); - o ~x:"x" 2 ; *) - -(* let u obj = - (obj##hi 1 2 : unit); - obj##hi ~x:"x" 2 - *) - -(* let u obj = - (obj##hi ~x:"x" 2 : unit); - (obj##hi 1 ~x:2 : unit) *) -(* let h (o : x:int -> int -> unit) = - o ~x:1 2 ; - o 1 2 ; *) - - -(* let h u = - let m = u##hi in - m 1 2 [@bs] - -;; h (object [@bs] method hi x y =x + y end ) - -Error: This expression has type < hi : (int -> int -> int [@bs.meth]) > - but an expression was expected of type - < hi : (int -> int -> 'a [@bs]); .. > - Types for method hi are incompatible *) \ No newline at end of file diff --git a/jscomp/test/build.ninja b/jscomp/test/build.ninja index ac8e0d208c..95a41a8aad 100644 --- a/jscomp/test/build.ninja +++ b/jscomp/test/build.ninja @@ -45,7 +45,6 @@ o test/arith_syntax.cmi test/arith_syntax.cmj : cc test/arith_syntax.ml | $bsc $ o test/arity.cmi test/arity.cmj : cc test/arity.res | $bsc $stdlib runtime o test/arity_deopt.cmi test/arity_deopt.cmj : cc test/arity_deopt.ml | test/mt.cmj $bsc $stdlib runtime o test/arity_infer.cmi test/arity_infer.cmj : cc test/arity_infer.ml | $bsc $stdlib runtime -o test/arity_ml.cmi test/arity_ml.cmj : cc test/arity_ml.ml | $bsc $stdlib runtime o test/array_data_util.cmi test/array_data_util.cmj : cc test/array_data_util.ml | $bsc $stdlib runtime o test/array_safe_get.cmi test/array_safe_get.cmj : cc test/array_safe_get.ml | $bsc $stdlib runtime o test/array_subtle_test.cmi test/array_subtle_test.cmj : cc test/array_subtle_test.ml | test/mt.cmj $bsc $stdlib runtime @@ -245,7 +244,6 @@ o test/gpr_1484.cmi test/gpr_1484.cmj : cc test/gpr_1484.ml | $bsc $stdlib runti o test/gpr_1501_test.cmi test/gpr_1501_test.cmj : cc test/gpr_1501_test.ml | test/mt.cmj $bsc $stdlib runtime o test/gpr_1503_test.cmi test/gpr_1503_test.cmj : cc test/gpr_1503_test.ml | test/mt.cmj $bsc $stdlib runtime o test/gpr_1539_test.cmi test/gpr_1539_test.cmj : cc test/gpr_1539_test.ml | $bsc $stdlib runtime -o test/gpr_1600_test.cmi test/gpr_1600_test.cmj : cc test/gpr_1600_test.ml | $bsc $stdlib runtime o test/gpr_1658_test.cmi test/gpr_1658_test.cmj : cc test/gpr_1658_test.ml | test/mt.cmj $bsc $stdlib runtime o test/gpr_1667_test.cmi test/gpr_1667_test.cmj : cc test/gpr_1667_test.ml | test/mt.cmj $bsc $stdlib runtime o test/gpr_1692_test.cmi test/gpr_1692_test.cmj : cc test/gpr_1692_test.ml | $bsc $stdlib runtime @@ -336,7 +334,6 @@ o test/gpr_5280_optimize_test.cmi test/gpr_5280_optimize_test.cmj : cc test/gpr_ o test/gpr_5312.cmi test/gpr_5312.cmj : cc test/gpr_5312.res | $bsc $stdlib runtime o test/gpr_5557.cmi test/gpr_5557.cmj : cc test/gpr_5557.res | $bsc $stdlib runtime o test/gpr_5753.cmi test/gpr_5753.cmj : cc test/gpr_5753.res | $bsc $stdlib runtime -o test/gpr_627_test.cmi test/gpr_627_test.cmj : cc test/gpr_627_test.ml | test/mt.cmj $bsc $stdlib runtime o test/gpr_658.cmi test/gpr_658.cmj : cc test/gpr_658.ml | $bsc $stdlib runtime o test/gpr_858_test.cmi test/gpr_858_test.cmj : cc test/gpr_858_test.ml | $bsc $stdlib runtime o test/gpr_858_unit2_test.cmi test/gpr_858_unit2_test.cmj : cc test/gpr_858_unit2_test.ml | $bsc $stdlib runtime @@ -500,8 +497,6 @@ o test/polymorphism_test.cmi : cc test/polymorphism_test.mli | $bsc $stdlib runt o test/polyvar_convert.cmi test/polyvar_convert.cmj : cc test/polyvar_convert.ml | $bsc $stdlib runtime o test/polyvar_test.cmi test/polyvar_test.cmj : cc test/polyvar_test.ml | $bsc $stdlib runtime o test/ppx_apply_test.cmi test/ppx_apply_test.cmj : cc test/ppx_apply_test.ml | test/mt.cmj $bsc $stdlib runtime -o test/ppx_this_obj_field.cmi test/ppx_this_obj_field.cmj : cc test/ppx_this_obj_field.ml | test/mt.cmj $bsc $stdlib runtime -o test/ppx_this_obj_test.cmi test/ppx_this_obj_test.cmj : cc test/ppx_this_obj_test.ml | test/mt.cmj $bsc $stdlib runtime o test/pq_test.cmi test/pq_test.cmj : cc test/pq_test.ml | $bsc $stdlib runtime o test/pr6726.cmi test/pr6726.cmj : cc test/pr6726.ml | $bsc $stdlib runtime o test/pr_regression_test.cmi test/pr_regression_test.cmj : cc test/pr_regression_test.ml | test/mt.cmj $bsc $stdlib runtime @@ -722,7 +717,6 @@ o test/uncurried_default.args.cmi test/uncurried_default.args.cmj : cc test/uncu o test/uncurried_pipe.cmi test/uncurried_pipe.cmj : cc test/uncurried_pipe.res | $bsc $stdlib runtime o test/uncurry_external_test.cmi test/uncurry_external_test.cmj : cc test/uncurry_external_test.res | test/mt.cmj $bsc $stdlib runtime o test/uncurry_glob_test.cmi test/uncurry_glob_test.cmj : cc test/uncurry_glob_test.res | $bsc $stdlib runtime -o test/uncurry_method.cmi test/uncurry_method.cmj : cc test/uncurry_method.ml | $bsc $stdlib runtime o test/uncurry_test.cmj : cc_cmi test/uncurry_test.res | test/uncurry_test.cmi $bsc $stdlib runtime o test/uncurry_test.cmi : cc test/uncurry_test.resi | $bsc $stdlib runtime o test/undef_regression2_test.cmi test/undef_regression2_test.cmj : cc test/undef_regression2_test.ml | test/mt.cmj $bsc $stdlib runtime @@ -741,4 +735,4 @@ o test/utf8_decode_test.cmi test/utf8_decode_test.cmj : cc test/utf8_decode_test o test/variant.cmi test/variant.cmj : cc test/variant.ml | $bsc $stdlib runtime o test/watch_test.cmi test/watch_test.cmj : cc test/watch_test.ml | $bsc $stdlib runtime o test/webpack_config.cmi test/webpack_config.cmj : cc test/webpack_config.ml | $bsc $stdlib runtime -o test : phony test/406_primitive_test.cmi test/406_primitive_test.cmj test/EmptyRecord.cmi test/EmptyRecord.cmj test/SafePromises.cmi test/SafePromises.cmj test/UncurriedExternals.cmi test/UncurriedExternals.cmj test/a.cmi test/a.cmj test/a_filename_test.cmi test/a_filename_test.cmj test/a_list_test.cmi test/a_list_test.cmj test/a_recursive_type.cmi test/a_recursive_type.cmj test/a_scope_bug.cmi test/a_scope_bug.cmj test/a_string_test.cmi test/a_string_test.cmj test/abstract_type.cmi test/abstract_type.cmj test/adt_optimize_test.cmi test/adt_optimize_test.cmj test/alias_test.cmi test/alias_test.cmj test/and_or_tailcall_test.cmi test/and_or_tailcall_test.cmj test/app_root_finder.cmi test/app_root_finder.cmj test/argv_test.cmi test/argv_test.cmj test/ari_regress_test.cmi test/ari_regress_test.cmj test/arith_lexer.cmi test/arith_lexer.cmj test/arith_parser.cmi test/arith_parser.cmj test/arith_syntax.cmi test/arith_syntax.cmj test/arity.cmi test/arity.cmj test/arity_deopt.cmi test/arity_deopt.cmj test/arity_infer.cmi test/arity_infer.cmj test/arity_ml.cmi test/arity_ml.cmj test/array_data_util.cmi test/array_data_util.cmj test/array_safe_get.cmi test/array_safe_get.cmj test/array_subtle_test.cmi test/array_subtle_test.cmj test/array_test.cmi test/array_test.cmj test/ast_abstract_test.cmi test/ast_abstract_test.cmj test/ast_js_mapper_poly_test.cmi test/ast_js_mapper_poly_test.cmj test/ast_js_mapper_test.cmi test/ast_js_mapper_test.cmj test/ast_mapper_defensive_test.cmi test/ast_mapper_defensive_test.cmj test/ast_mapper_unused_warning_test.cmi test/ast_mapper_unused_warning_test.cmj test/async_ideas.cmi test/async_ideas.cmj test/async_inline.cmi test/async_inline.cmj test/attr_test.cmi test/attr_test.cmj test/b.cmi test/b.cmj test/bal_set_mini.cmi test/bal_set_mini.cmj test/bang_primitive.cmi test/bang_primitive.cmj test/basic_module_test.cmi test/basic_module_test.cmj test/bb.cmi test/bb.cmj test/bdd.cmi test/bdd.cmj test/belt_internal_test.cmi test/belt_internal_test.cmj test/belt_result_alias_test.cmi test/belt_result_alias_test.cmj test/bench.cmi test/bench.cmj test/big_enum.cmi test/big_enum.cmj test/big_polyvar_test.cmi test/big_polyvar_test.cmj test/block_alias_test.cmi test/block_alias_test.cmj test/boolean_test.cmi test/boolean_test.cmj test/bs_MapInt_test.cmi test/bs_MapInt_test.cmj test/bs_abstract_test.cmi test/bs_abstract_test.cmj test/bs_array_test.cmi test/bs_array_test.cmj test/bs_auto_uncurry.cmi test/bs_auto_uncurry.cmj test/bs_auto_uncurry_test.cmi test/bs_auto_uncurry_test.cmj test/bs_float_test.cmi test/bs_float_test.cmj test/bs_hashmap_test.cmi test/bs_hashmap_test.cmj test/bs_hashset_int_test.cmi test/bs_hashset_int_test.cmj test/bs_hashtbl_string_test.cmi test/bs_hashtbl_string_test.cmj test/bs_ignore_effect.cmi test/bs_ignore_effect.cmj test/bs_ignore_test.cmi test/bs_ignore_test.cmj test/bs_int_test.cmi test/bs_int_test.cmj test/bs_list_test.cmi test/bs_list_test.cmj test/bs_map_set_dict_test.cmi test/bs_map_set_dict_test.cmj test/bs_map_test.cmi test/bs_map_test.cmj test/bs_min_max_test.cmi test/bs_min_max_test.cmj test/bs_mutable_set_test.cmi test/bs_mutable_set_test.cmj test/bs_node_string_buffer_test.cmi test/bs_node_string_buffer_test.cmj test/bs_poly_map_test.cmi test/bs_poly_map_test.cmj test/bs_poly_mutable_map_test.cmi test/bs_poly_mutable_map_test.cmj test/bs_poly_mutable_set_test.cmi test/bs_poly_mutable_set_test.cmj test/bs_poly_set_test.cmi test/bs_poly_set_test.cmj test/bs_qualified.cmi test/bs_qualified.cmj test/bs_queue_test.cmi test/bs_queue_test.cmj test/bs_rbset_int_bench.cmi test/bs_rbset_int_bench.cmj test/bs_rest_test.cmi test/bs_rest_test.cmj test/bs_set_bench.cmi test/bs_set_bench.cmj test/bs_set_int_test.cmi test/bs_set_int_test.cmj test/bs_sort_test.cmi test/bs_sort_test.cmj test/bs_splice_partial.cmi test/bs_splice_partial.cmj test/bs_stack_test.cmi test/bs_stack_test.cmj test/bs_string_test.cmi test/bs_string_test.cmj test/bs_unwrap_test.cmi test/bs_unwrap_test.cmj test/buffer_test.cmi test/buffer_test.cmj test/bytes_split_gpr_743_test.cmi test/bytes_split_gpr_743_test.cmj test/caml_compare_test.cmi test/caml_compare_test.cmj test/caml_format_test.cmi test/caml_format_test.cmj test/caml_sys_poly_fill_test.cmi test/caml_sys_poly_fill_test.cmj test/chain_code_test.cmi test/chain_code_test.cmj test/chn_test.cmi test/chn_test.cmj test/class_setter_getter.cmi test/class_setter_getter.cmj test/class_type_ffi_test.cmi test/class_type_ffi_test.cmj test/coercion_module_alias_test.cmi test/coercion_module_alias_test.cmj test/compare_test.cmi test/compare_test.cmj test/complete_parmatch_test.cmi test/complete_parmatch_test.cmj test/complex_if_test.cmi test/complex_if_test.cmj test/complex_test.cmi test/complex_test.cmj test/complex_while_loop.cmi test/complex_while_loop.cmj test/condition_compilation_test.cmi test/condition_compilation_test.cmj test/config1_test.cmi test/config1_test.cmj test/config2_test.cmi test/config2_test.cmj test/console_log_test.cmi test/console_log_test.cmj test/const_block_test.cmi test/const_block_test.cmj test/const_defs.cmi test/const_defs.cmj test/const_defs_test.cmi test/const_defs_test.cmj test/const_test.cmi test/const_test.cmj test/cont_int_fold_test.cmi test/cont_int_fold_test.cmj test/cps_test.cmi test/cps_test.cmj test/cross_module_inline_test.cmi test/cross_module_inline_test.cmj test/custom_error_test.cmi test/custom_error_test.cmj test/debug_keep_test.cmi test/debug_keep_test.cmj test/debug_mode_value.cmi test/debug_mode_value.cmj test/debug_tmp.cmi test/debug_tmp.cmj test/debugger_test.cmi test/debugger_test.cmj test/default_export_test.cmi test/default_export_test.cmj test/defunctor_make_test.cmi test/defunctor_make_test.cmj test/demo.cmi test/demo.cmj test/demo_binding.cmi test/demo_binding.cmj test/demo_int_map.cmi test/demo_int_map.cmj test/demo_page.cmi test/demo_page.cmj test/demo_pipe.cmi test/demo_pipe.cmj test/derive_dyntype.cmi test/derive_dyntype.cmj test/derive_projector_test.cmi test/derive_projector_test.cmj test/derive_type_test.cmi test/derive_type_test.cmj test/digest_test.cmi test/digest_test.cmj test/div_by_zero_test.cmi test/div_by_zero_test.cmj test/dollar_escape_test.cmi test/dollar_escape_test.cmj test/earger_curry_test.cmi test/earger_curry_test.cmj test/effect.cmi test/effect.cmj test/epsilon_test.cmi test/epsilon_test.cmj test/equal_box_test.cmi test/equal_box_test.cmj test/equal_exception_test.cmi test/equal_exception_test.cmj test/equal_test.cmi test/equal_test.cmj test/es6_export.cmi test/es6_export.cmj test/es6_import.cmi test/es6_import.cmj test/es6_module_test.cmi test/es6_module_test.cmj test/escape_esmodule.cmi test/escape_esmodule.cmj test/esmodule_ref.cmi test/esmodule_ref.cmj test/event_ffi.cmi test/event_ffi.cmj test/exception_alias.cmi test/exception_alias.cmj test/exception_def.cmi test/exception_def.cmj test/exception_raise_test.cmi test/exception_raise_test.cmj test/exception_rebind_test.cmi test/exception_rebind_test.cmj test/exception_rebound_err_test.cmi test/exception_rebound_err_test.cmj test/exception_repr_test.cmi test/exception_repr_test.cmj test/exception_value_test.cmi test/exception_value_test.cmj test/exn_error_pattern.cmi test/exn_error_pattern.cmj test/export_keyword.cmi test/export_keyword.cmj test/ext_array_test.cmi test/ext_array_test.cmj test/ext_bytes_test.cmi test/ext_bytes_test.cmj test/ext_filename_test.cmi test/ext_filename_test.cmj test/ext_list_test.cmi test/ext_list_test.cmj test/ext_pervasives_test.cmi test/ext_pervasives_test.cmj test/ext_string_test.cmi test/ext_string_test.cmj test/ext_sys_test.cmi test/ext_sys_test.cmj test/extensible_variant_test.cmi test/extensible_variant_test.cmj test/external_polyfill_test.cmi test/external_polyfill_test.cmj test/external_ppx.cmi test/external_ppx.cmj test/external_ppx2.cmi test/external_ppx2.cmj test/fail_comp.cmi test/fail_comp.cmj test/ffi_arity_test.cmi test/ffi_arity_test.cmj test/ffi_array_test.cmi test/ffi_array_test.cmj test/ffi_js_test.cmi test/ffi_js_test.cmj test/ffi_splice_test.cmi test/ffi_splice_test.cmj test/ffi_test.cmi test/ffi_test.cmj test/fib.cmi test/fib.cmj test/flattern_order_test.cmi test/flattern_order_test.cmj test/flexible_array_test.cmi test/flexible_array_test.cmj test/float_array.cmi test/float_array.cmj test/float_of_bits_test.cmi test/float_of_bits_test.cmj test/float_record.cmi test/float_record.cmj test/float_test.cmi test/float_test.cmj test/floatarray_test.cmi test/floatarray_test.cmj test/flow_parser_reg_test.cmi test/flow_parser_reg_test.cmj test/for_loop_test.cmi test/for_loop_test.cmj test/for_side_effect_test.cmi test/for_side_effect_test.cmj test/format_regression.cmi test/format_regression.cmj test/format_test.cmi test/format_test.cmj test/fs_test.cmi test/fs_test.cmj test/fun_pattern_match.cmi test/fun_pattern_match.cmj test/functor_app_test.cmi test/functor_app_test.cmj test/functor_def.cmi test/functor_def.cmj test/functor_ffi.cmi test/functor_ffi.cmj test/functor_inst.cmi test/functor_inst.cmj test/functors.cmi test/functors.cmj test/gbk.cmi test/gbk.cmj test/genlex_test.cmi test/genlex_test.cmj test/gentTypeReTest.cmi test/gentTypeReTest.cmj test/global_exception_regression_test.cmi test/global_exception_regression_test.cmj test/global_mangles.cmi test/global_mangles.cmj test/global_module_alias_test.cmi test/global_module_alias_test.cmj test/google_closure_test.cmi test/google_closure_test.cmj test/gpr496_test.cmi test/gpr496_test.cmj test/gpr_1063_test.cmi test/gpr_1063_test.cmj test/gpr_1072.cmi test/gpr_1072.cmj test/gpr_1072_reg.cmi test/gpr_1072_reg.cmj test/gpr_1150.cmi test/gpr_1150.cmj test/gpr_1154_test.cmi test/gpr_1154_test.cmj test/gpr_1170.cmi test/gpr_1170.cmj test/gpr_1240_missing_unbox.cmi test/gpr_1240_missing_unbox.cmj test/gpr_1245_test.cmi test/gpr_1245_test.cmj test/gpr_1268.cmi test/gpr_1268.cmj test/gpr_1409_test.cmi test/gpr_1409_test.cmj test/gpr_1423_app_test.cmi test/gpr_1423_app_test.cmj test/gpr_1423_nav.cmi test/gpr_1423_nav.cmj test/gpr_1438.cmi test/gpr_1438.cmj test/gpr_1481.cmi test/gpr_1481.cmj test/gpr_1484.cmi test/gpr_1484.cmj test/gpr_1501_test.cmi test/gpr_1501_test.cmj test/gpr_1503_test.cmi test/gpr_1503_test.cmj test/gpr_1539_test.cmi test/gpr_1539_test.cmj test/gpr_1600_test.cmi test/gpr_1600_test.cmj test/gpr_1658_test.cmi test/gpr_1658_test.cmj test/gpr_1667_test.cmi test/gpr_1667_test.cmj test/gpr_1692_test.cmi test/gpr_1692_test.cmj test/gpr_1698_test.cmi test/gpr_1698_test.cmj test/gpr_1701_test.cmi test/gpr_1701_test.cmj test/gpr_1716_test.cmi test/gpr_1716_test.cmj test/gpr_1717_test.cmi test/gpr_1717_test.cmj test/gpr_1728_test.cmi test/gpr_1728_test.cmj test/gpr_1749_test.cmi test/gpr_1749_test.cmj test/gpr_1759_test.cmi test/gpr_1759_test.cmj test/gpr_1760_test.cmi test/gpr_1760_test.cmj test/gpr_1762_test.cmi test/gpr_1762_test.cmj test/gpr_1817_test.cmi test/gpr_1817_test.cmj test/gpr_1822_test.cmi test/gpr_1822_test.cmj test/gpr_1891_test.cmi test/gpr_1891_test.cmj test/gpr_1943_test.cmi test/gpr_1943_test.cmj test/gpr_1946_test.cmi test/gpr_1946_test.cmj test/gpr_2316_test.cmi test/gpr_2316_test.cmj test/gpr_2352_test.cmi test/gpr_2352_test.cmj test/gpr_2413_test.cmi test/gpr_2413_test.cmj test/gpr_2474.cmi test/gpr_2474.cmj test/gpr_2487.cmi test/gpr_2487.cmj test/gpr_2503_test.cmi test/gpr_2503_test.cmj test/gpr_2608_test.cmi test/gpr_2608_test.cmj test/gpr_2614_test.cmi test/gpr_2614_test.cmj test/gpr_2633_test.cmi test/gpr_2633_test.cmj test/gpr_2642_test.cmi test/gpr_2642_test.cmj test/gpr_2652_test.cmi test/gpr_2652_test.cmj test/gpr_2682_test.cmi test/gpr_2682_test.cmj test/gpr_2700_test.cmi test/gpr_2700_test.cmj test/gpr_2731_test.cmi test/gpr_2731_test.cmj test/gpr_2789_test.cmi test/gpr_2789_test.cmj test/gpr_2931_test.cmi test/gpr_2931_test.cmj test/gpr_3142_test.cmi test/gpr_3142_test.cmj test/gpr_3154_test.cmi test/gpr_3154_test.cmj test/gpr_3209_test.cmi test/gpr_3209_test.cmj test/gpr_3492_test.cmi test/gpr_3492_test.cmj test/gpr_3519_jsx_test.cmi test/gpr_3519_jsx_test.cmj test/gpr_3519_test.cmi test/gpr_3519_test.cmj test/gpr_3536_test.cmi test/gpr_3536_test.cmj test/gpr_3546_test.cmi test/gpr_3546_test.cmj test/gpr_3548_test.cmi test/gpr_3548_test.cmj test/gpr_3549_test.cmi test/gpr_3549_test.cmj test/gpr_3566_drive_test.cmi test/gpr_3566_drive_test.cmj test/gpr_3566_test.cmi test/gpr_3566_test.cmj test/gpr_3595_test.cmi test/gpr_3595_test.cmj test/gpr_3609_test.cmi test/gpr_3609_test.cmj test/gpr_3697_test.cmi test/gpr_3697_test.cmj test/gpr_373_test.cmi test/gpr_373_test.cmj test/gpr_3770_test.cmi test/gpr_3770_test.cmj test/gpr_3852_alias.cmi test/gpr_3852_alias.cmj test/gpr_3852_alias_reify.cmi test/gpr_3852_alias_reify.cmj test/gpr_3852_effect.cmi test/gpr_3852_effect.cmj test/gpr_3865.cmi test/gpr_3865.cmj test/gpr_3865_bar.cmi test/gpr_3865_bar.cmj test/gpr_3865_foo.cmi test/gpr_3865_foo.cmj test/gpr_3875_test.cmi test/gpr_3875_test.cmj test/gpr_3877_test.cmi test/gpr_3877_test.cmj test/gpr_3895_test.cmi test/gpr_3895_test.cmj test/gpr_3897_test.cmi test/gpr_3897_test.cmj test/gpr_3931_test.cmi test/gpr_3931_test.cmj test/gpr_3980_test.cmi test/gpr_3980_test.cmj test/gpr_4025_test.cmi test/gpr_4025_test.cmj test/gpr_405_test.cmi test/gpr_405_test.cmj test/gpr_4069_test.cmi test/gpr_4069_test.cmj test/gpr_4265_test.cmi test/gpr_4265_test.cmj test/gpr_4274_test.cmi test/gpr_4274_test.cmj test/gpr_4280_test.cmi test/gpr_4280_test.cmj test/gpr_4407_test.cmi test/gpr_4407_test.cmj test/gpr_441.cmi test/gpr_441.cmj test/gpr_4442_test.cmi test/gpr_4442_test.cmj test/gpr_4491_test.cmi test/gpr_4491_test.cmj test/gpr_4494_test.cmi test/gpr_4494_test.cmj test/gpr_4519_test.cmi test/gpr_4519_test.cmj test/gpr_459_test.cmi test/gpr_459_test.cmj test/gpr_4632.cmi test/gpr_4632.cmj test/gpr_4639_test.cmi test/gpr_4639_test.cmj test/gpr_4900_test.cmi test/gpr_4900_test.cmj test/gpr_4924_test.cmi test/gpr_4924_test.cmj test/gpr_4931.cmi test/gpr_4931.cmj test/gpr_4931_allow.cmi test/gpr_4931_allow.cmj test/gpr_5071_test.cmi test/gpr_5071_test.cmj test/gpr_5169_test.cmi test/gpr_5169_test.cmj test/gpr_5218_test.cmi test/gpr_5218_test.cmj test/gpr_5280_optimize_test.cmi test/gpr_5280_optimize_test.cmj test/gpr_5312.cmi test/gpr_5312.cmj test/gpr_5557.cmi test/gpr_5557.cmj test/gpr_5753.cmi test/gpr_5753.cmj test/gpr_627_test.cmi test/gpr_627_test.cmj test/gpr_658.cmi test/gpr_658.cmj test/gpr_858_test.cmi test/gpr_858_test.cmj test/gpr_858_unit2_test.cmi test/gpr_858_unit2_test.cmj test/gpr_904_test.cmi test/gpr_904_test.cmj test/gpr_974_test.cmi test/gpr_974_test.cmj test/gpr_977_test.cmi test/gpr_977_test.cmj test/gpr_return_type_unused_attribute.cmi test/gpr_return_type_unused_attribute.cmj test/gray_code_test.cmi test/gray_code_test.cmj test/guide_for_ext.cmi test/guide_for_ext.cmj test/hamming_test.cmi test/hamming_test.cmj test/hash_collision_test.cmi test/hash_collision_test.cmj test/hash_sugar_desugar.cmi test/hash_sugar_desugar.cmj test/hash_test.cmi test/hash_test.cmj test/hashtbl_test.cmi test/hashtbl_test.cmj test/hello.foo.cmi test/hello.foo.cmj test/hello_res.cmi test/hello_res.cmj test/http_types.cmi test/http_types.cmj test/ignore_test.cmi test/ignore_test.cmj test/imm_map_bench.cmi test/imm_map_bench.cmj test/include_side_effect.cmi test/include_side_effect.cmj test/include_side_effect_free.cmi test/include_side_effect_free.cmj test/incomplete_toplevel_test.cmi test/incomplete_toplevel_test.cmj test/infer_type_test.cmi test/infer_type_test.cmj test/inline_const.cmi test/inline_const.cmj test/inline_const_test.cmi test/inline_const_test.cmj test/inline_edge_cases.cmi test/inline_edge_cases.cmj test/inline_map2_test.cmi test/inline_map2_test.cmj test/inline_map_demo.cmi test/inline_map_demo.cmj test/inline_map_test.cmi test/inline_map_test.cmj test/inline_record_test.cmi test/inline_record_test.cmj test/inline_regression_test.cmi test/inline_regression_test.cmj test/inline_string_test.cmi test/inline_string_test.cmj test/inner_call.cmi test/inner_call.cmj test/inner_define.cmi test/inner_define.cmj test/inner_unused.cmi test/inner_unused.cmj test/installation_test.cmi test/installation_test.cmj test/int32_test.cmi test/int32_test.cmj test/int64_mul_div_test.cmi test/int64_mul_div_test.cmj test/int64_string_bench.cmi test/int64_string_bench.cmj test/int64_string_test.cmi test/int64_string_test.cmj test/int64_test.cmi test/int64_test.cmj test/int_hashtbl_test.cmi test/int_hashtbl_test.cmj test/int_map.cmi test/int_map.cmj test/int_overflow_test.cmi test/int_overflow_test.cmj test/int_poly_var.cmi test/int_poly_var.cmj test/int_switch_test.cmi test/int_switch_test.cmj test/internal_unused_test.cmi test/internal_unused_test.cmj test/io_test.cmi test/io_test.cmj test/js_array_test.cmi test/js_array_test.cmj test/js_bool_test.cmi test/js_bool_test.cmj test/js_cast_test.cmi test/js_cast_test.cmj test/js_date_test.cmi test/js_date_test.cmj test/js_dict_test.cmi test/js_dict_test.cmj test/js_exception_catch_test.cmi test/js_exception_catch_test.cmj test/js_float_test.cmi test/js_float_test.cmj test/js_global_test.cmi test/js_global_test.cmj test/js_int_test.cmi test/js_int_test.cmj test/js_json_test.cmi test/js_json_test.cmj test/js_list_test.cmi test/js_list_test.cmj test/js_math_test.cmi test/js_math_test.cmj test/js_null_test.cmi test/js_null_test.cmj test/js_null_undefined_test.cmi test/js_null_undefined_test.cmj test/js_nullable_test.cmi test/js_nullable_test.cmj test/js_obj_test.cmi test/js_obj_test.cmj test/js_option_test.cmi test/js_option_test.cmj test/js_promise_basic_test.cmi test/js_promise_basic_test.cmj test/js_re_test.cmi test/js_re_test.cmj test/js_string_test.cmi test/js_string_test.cmj test/js_typed_array_test.cmi test/js_typed_array_test.cmj test/js_undefined_test.cmi test/js_undefined_test.cmj test/js_val.cmi test/js_val.cmj test/jsoo_400_test.cmi test/jsoo_400_test.cmj test/jsoo_485_test.cmi test/jsoo_485_test.cmj test/key_word_property.cmi test/key_word_property.cmj test/key_word_property2.cmi test/key_word_property2.cmj test/key_word_property_plus_test.cmi test/key_word_property_plus_test.cmj test/label_uncurry.cmi test/label_uncurry.cmj test/large_integer_pat.cmi test/large_integer_pat.cmj test/large_record_duplication_test.cmi test/large_record_duplication_test.cmj test/largest_int_flow.cmi test/largest_int_flow.cmj test/lazy_demo.cmi test/lazy_demo.cmj test/lazy_test.cmi test/lazy_test.cmj test/lexer_test.cmi test/lexer_test.cmj test/lib_js_test.cmi test/lib_js_test.cmj test/libarg_test.cmi test/libarg_test.cmj test/libqueue_test.cmi test/libqueue_test.cmj test/limits_test.cmi test/limits_test.cmj test/list_stack.cmi test/list_stack.cmj test/list_test.cmi test/list_test.cmj test/local_class_type.cmi test/local_class_type.cmj test/local_exception_test.cmi test/local_exception_test.cmj test/loop_regression_test.cmi test/loop_regression_test.cmj test/loop_suites_test.cmi test/loop_suites_test.cmj test/map_find_test.cmi test/map_find_test.cmj test/map_test.cmi test/map_test.cmj test/mario_game.cmi test/mario_game.cmj test/marshal.cmi test/marshal.cmj test/method_chain.cmi test/method_chain.cmj test/method_name_test.cmi test/method_name_test.cmj test/method_string_name.cmi test/method_string_name.cmj test/minimal_test.cmi test/minimal_test.cmj test/miss_colon_test.cmi test/miss_colon_test.cmj test/mock_mt.cmi test/mock_mt.cmj test/module_alias_test.cmi test/module_alias_test.cmj test/module_as_class_ffi.cmi test/module_as_class_ffi.cmj test/module_as_function.cmi test/module_as_function.cmj test/module_missing_conversion.cmi test/module_missing_conversion.cmj test/module_parameter_test.cmi test/module_parameter_test.cmj test/module_splice_test.cmi test/module_splice_test.cmj test/more_poly_variant_test.cmi test/more_poly_variant_test.cmj test/more_uncurry.cmi test/more_uncurry.cmj test/mpr_6033_test.cmi test/mpr_6033_test.cmj test/mt.cmi test/mt.cmj test/mt_global.cmi test/mt_global.cmj test/mutable_obj_test.cmi test/mutable_obj_test.cmj test/mutable_uncurry_test.cmi test/mutable_uncurry_test.cmj test/mutual_non_recursive_type.cmi test/mutual_non_recursive_type.cmj test/name_mangle_test.cmi test/name_mangle_test.cmj test/nested_include.cmi test/nested_include.cmj test/nested_module_alias.cmi test/nested_module_alias.cmj test/nested_obj_literal.cmi test/nested_obj_literal.cmj test/nested_obj_test.cmi test/nested_obj_test.cmj test/nested_pattern_match_test.cmi test/nested_pattern_match_test.cmj test/noassert.cmi test/noassert.cmj test/node_fs_test.cmi test/node_fs_test.cmj test/node_path_test.cmi test/node_path_test.cmj test/null_list_test.cmi test/null_list_test.cmj test/number_lexer.cmi test/number_lexer.cmj test/obj_literal_ppx.cmi test/obj_literal_ppx.cmj test/obj_literal_ppx_test.cmi test/obj_literal_ppx_test.cmj test/obj_magic_test.cmi test/obj_magic_test.cmj test/obj_type_test.cmi test/obj_type_test.cmj test/ocaml_re_test.cmi test/ocaml_re_test.cmj test/of_string_test.cmi test/of_string_test.cmj test/offset.cmi test/offset.cmj test/oo_js_test_date.cmi test/oo_js_test_date.cmj test/option_encoding_test.cmi test/option_encoding_test.cmj test/option_record_none_test.cmi test/option_record_none_test.cmj test/option_repr_test.cmi test/option_repr_test.cmj test/optional_ffi_test.cmi test/optional_ffi_test.cmj test/optional_regression_test.cmi test/optional_regression_test.cmj test/pipe_send_readline.cmi test/pipe_send_readline.cmj test/pipe_syntax.cmi test/pipe_syntax.cmj test/poly_empty_array.cmi test/poly_empty_array.cmj test/poly_type.cmi test/poly_type.cmj test/poly_variant_test.cmi test/poly_variant_test.cmj test/polymorphic_raw_test.cmi test/polymorphic_raw_test.cmj test/polymorphism_test.cmi test/polymorphism_test.cmj test/polyvar_convert.cmi test/polyvar_convert.cmj test/polyvar_test.cmi test/polyvar_test.cmj test/ppx_apply_test.cmi test/ppx_apply_test.cmj test/ppx_this_obj_field.cmi test/ppx_this_obj_field.cmj test/ppx_this_obj_test.cmi test/ppx_this_obj_test.cmj test/pq_test.cmi test/pq_test.cmj test/pr6726.cmi test/pr6726.cmj test/pr_regression_test.cmi test/pr_regression_test.cmj test/prepend_data_ffi.cmi test/prepend_data_ffi.cmj test/primitive_reg_test.cmi test/primitive_reg_test.cmj test/print_alpha_test.cmi test/print_alpha_test.cmj test/promise.cmi test/promise.cmj test/promise_catch_test.cmi test/promise_catch_test.cmj test/queue_402.cmi test/queue_402.cmj test/queue_test.cmi test/queue_test.cmj test/random_test.cmi test/random_test.cmj test/raw_hash_tbl_bench.cmi test/raw_hash_tbl_bench.cmj test/raw_output_test.cmi test/raw_output_test.cmj test/raw_pure_test.cmi test/raw_pure_test.cmj test/rbset.cmi test/rbset.cmj test/react.cmi test/react.cmj test/reactDOMRe.cmi test/reactDOMRe.cmj test/reactDOMServerRe.cmi test/reactDOMServerRe.cmj test/reactEvent.cmi test/reactEvent.cmj test/reactTestUtils.cmi test/reactTestUtils.cmj test/reasonReact.cmi test/reasonReact.cmj test/reasonReactCompat.cmi test/reasonReactCompat.cmj test/reasonReactOptimizedCreateClass.cmi test/reasonReactOptimizedCreateClass.cmj test/reasonReactRouter.cmi test/reasonReactRouter.cmj test/rebind_module.cmi test/rebind_module.cmj test/rebind_module_test.cmi test/rebind_module_test.cmj test/rec_array_test.cmi test/rec_array_test.cmj test/rec_fun_test.cmi test/rec_fun_test.cmj test/rec_module_opt.cmi test/rec_module_opt.cmj test/rec_module_test.cmi test/rec_module_test.cmj test/rec_value_test.cmi test/rec_value_test.cmj test/record_debug_test.cmi test/record_debug_test.cmj test/record_extension_test.cmi test/record_extension_test.cmj test/record_name_test.cmi test/record_name_test.cmj test/record_regression.cmi test/record_regression.cmj test/record_with_test.cmi test/record_with_test.cmj test/recursive_module.cmi test/recursive_module.cmj test/recursive_module_test.cmi test/recursive_module_test.cmj test/recursive_react_component.cmi test/recursive_react_component.cmj test/recursive_records_test.cmi test/recursive_records_test.cmj test/recursive_unbound_module_test.cmi test/recursive_unbound_module_test.cmj test/regression_print.cmi test/regression_print.cmj test/relative_path.cmi test/relative_path.cmj test/res_debug.cmi test/res_debug.cmj test/return_check.cmi test/return_check.cmj test/runtime_encoding_test.cmi test/runtime_encoding_test.cmj test/set_gen.cmi test/set_gen.cmj test/sexp.cmi test/sexp.cmj test/sexpm.cmi test/sexpm.cmj test/sexpm_test.cmi test/sexpm_test.cmj test/side_effect.cmi test/side_effect.cmj test/side_effect_free.cmi test/side_effect_free.cmj test/simple_derive_test.cmi test/simple_derive_test.cmj test/simple_derive_use.cmi test/simple_derive_use.cmj test/simple_lexer_test.cmi test/simple_lexer_test.cmj test/simplify_lambda_632o.cmi test/simplify_lambda_632o.cmj test/single_module_alias.cmi test/single_module_alias.cmj test/singular_unit_test.cmi test/singular_unit_test.cmj test/small_inline_test.cmi test/small_inline_test.cmj test/splice_test.cmi test/splice_test.cmj test/stack_comp_test.cmi test/stack_comp_test.cmj test/stack_test.cmi test/stack_test.cmj test/stream_parser_test.cmi test/stream_parser_test.cmj test/string_bound_get_test.cmi test/string_bound_get_test.cmj test/string_get_set_test.cmi test/string_get_set_test.cmj test/string_interp_test.cmi test/string_interp_test.cmj test/string_literal_print_test.cmi test/string_literal_print_test.cmj test/string_runtime_test.cmi test/string_runtime_test.cmj test/string_set.cmi test/string_set.cmj test/string_set_test.cmi test/string_set_test.cmj test/string_test.cmi test/string_test.cmj test/string_unicode_test.cmi test/string_unicode_test.cmj test/stringmatch_test.cmi test/stringmatch_test.cmj test/submodule.cmi test/submodule.cmj test/submodule_call.cmi test/submodule_call.cmj test/switch_case_test.cmi test/switch_case_test.cmj test/tailcall_inline_test.cmi test/tailcall_inline_test.cmj test/template.cmi test/template.cmj test/test.cmi test/test.cmj test/test2.cmi test/test2.cmj test/test_alias.cmi test/test_alias.cmj test/test_ari.cmi test/test_ari.cmj test/test_array.cmi test/test_array.cmj test/test_array_append.cmi test/test_array_append.cmj test/test_array_primitive.cmi test/test_array_primitive.cmj test/test_bool_equal.cmi test/test_bool_equal.cmj test/test_bs_this.cmi test/test_bs_this.cmj test/test_bug.cmi test/test_bug.cmj test/test_bytes.cmi test/test_bytes.cmj test/test_case_opt_collision.cmi test/test_case_opt_collision.cmj test/test_case_set.cmi test/test_case_set.cmj test/test_char.cmi test/test_char.cmj test/test_closure.cmi test/test_closure.cmj test/test_common.cmi test/test_common.cmj test/test_const_elim.cmi test/test_const_elim.cmj test/test_const_propogate.cmi test/test_const_propogate.cmj test/test_cpp.cmi test/test_cpp.cmj test/test_cps.cmi test/test_cps.cmj test/test_demo.cmi test/test_demo.cmj test/test_dup_param.cmi test/test_dup_param.cmj test/test_eq.cmi test/test_eq.cmj test/test_exception.cmi test/test_exception.cmj test/test_exception_escape.cmi test/test_exception_escape.cmj test/test_export2.cmi test/test_export2.cmj test/test_external.cmi test/test_external.cmj test/test_external_unit.cmi test/test_external_unit.cmj test/test_ffi.cmi test/test_ffi.cmj test/test_fib.cmi test/test_fib.cmj test/test_filename.cmi test/test_filename.cmj test/test_for_loop.cmi test/test_for_loop.cmj test/test_for_map.cmi test/test_for_map.cmj test/test_for_map2.cmi test/test_for_map2.cmj test/test_format.cmi test/test_format.cmj test/test_formatter.cmi test/test_formatter.cmj test/test_functor_dead_code.cmi test/test_functor_dead_code.cmj test/test_generative_module.cmi test/test_generative_module.cmj test/test_global_print.cmi test/test_global_print.cmj test/test_google_closure.cmi test/test_google_closure.cmj test/test_http_server.cmi test/test_http_server.cmj test/test_include.cmi test/test_include.cmj test/test_incomplete.cmi test/test_incomplete.cmj test/test_incr_ref.cmi test/test_incr_ref.cmj test/test_index.cmi test/test_index.cmj test/test_int_map_find.cmi test/test_int_map_find.cmj test/test_internalOO.cmi test/test_internalOO.cmj test/test_is_js.cmi test/test_is_js.cmj test/test_js_ffi.cmi test/test_js_ffi.cmj test/test_let.cmi test/test_let.cmj test/test_list.cmi test/test_list.cmj test/test_literal.cmi test/test_literal.cmj test/test_literals.cmi test/test_literals.cmj test/test_match_exception.cmi test/test_match_exception.cmj test/test_mutliple.cmi test/test_mutliple.cmj test/test_nat64.cmi test/test_nat64.cmj test/test_nested_let.cmi test/test_nested_let.cmj test/test_nested_print.cmi test/test_nested_print.cmj test/test_non_export.cmi test/test_non_export.cmj test/test_nullary.cmi test/test_nullary.cmj test/test_obj.cmi test/test_obj.cmj test/test_obj_simple_ffi.cmi test/test_obj_simple_ffi.cmj test/test_order.cmi test/test_order.cmj test/test_order_tailcall.cmi test/test_order_tailcall.cmj test/test_other_exn.cmi test/test_other_exn.cmj test/test_pack.cmi test/test_pack.cmj test/test_per.cmi test/test_per.cmj test/test_pervasive.cmi test/test_pervasive.cmj test/test_pervasives2.cmi test/test_pervasives2.cmj test/test_pervasives3.cmi test/test_pervasives3.cmj test/test_primitive.cmi test/test_primitive.cmj test/test_promise_bind.cmi test/test_promise_bind.cmj test/test_ramification.cmi test/test_ramification.cmj test/test_react.cmi test/test_react.cmj test/test_react_case.cmi test/test_react_case.cmj test/test_regex.cmi test/test_regex.cmj test/test_require.cmi test/test_require.cmj test/test_runtime_encoding.cmi test/test_runtime_encoding.cmj test/test_scope.cmi test/test_scope.cmj test/test_seq.cmi test/test_seq.cmj test/test_set.cmi test/test_set.cmj test/test_side_effect_functor.cmi test/test_side_effect_functor.cmj test/test_simple_include.cmi test/test_simple_include.cmj test/test_simple_pattern_match.cmi test/test_simple_pattern_match.cmj test/test_simple_ref.cmi test/test_simple_ref.cmj test/test_simple_tailcall.cmi test/test_simple_tailcall.cmj test/test_small.cmi test/test_small.cmj test/test_sprintf.cmi test/test_sprintf.cmj test/test_stack.cmi test/test_stack.cmj test/test_static_catch_ident.cmi test/test_static_catch_ident.cmj test/test_string.cmi test/test_string.cmj test/test_string_case.cmi test/test_string_case.cmj test/test_string_const.cmi test/test_string_const.cmj test/test_string_map.cmi test/test_string_map.cmj test/test_string_switch.cmi test/test_string_switch.cmj test/test_switch.cmi test/test_switch.cmj test/test_trywith.cmi test/test_trywith.cmj test/test_tuple.cmi test/test_tuple.cmj test/test_tuple_destructring.cmi test/test_tuple_destructring.cmj test/test_type_based_arity.cmi test/test_type_based_arity.cmj test/test_u.cmi test/test_u.cmj test/test_unknown.cmi test/test_unknown.cmj test/test_unsafe_cmp.cmi test/test_unsafe_cmp.cmj test/test_unsafe_obj_ffi.cmi test/test_unsafe_obj_ffi.cmj test/test_unsafe_obj_ffi_ppx.cmi test/test_unsafe_obj_ffi_ppx.cmj test/test_unsupported_primitive.cmi test/test_unsupported_primitive.cmj test/test_while_closure.cmi test/test_while_closure.cmj test/test_while_side_effect.cmi test/test_while_side_effect.cmj test/test_zero_nullable.cmi test/test_zero_nullable.cmj test/then_mangle_test.cmi test/then_mangle_test.cmj test/ticker.cmi test/ticker.cmj test/to_string_test.cmi test/to_string_test.cmj test/topsort_test.cmi test/topsort_test.cmj test/tramp_fib.cmi test/tramp_fib.cmj test/tuple_alloc.cmi test/tuple_alloc.cmj test/type_disambiguate.cmi test/type_disambiguate.cmj test/typeof_test.cmi test/typeof_test.cmj test/ui_defs.cmi test/unboxed_attribute.cmi test/unboxed_attribute.cmj test/unboxed_attribute_test.cmi test/unboxed_attribute_test.cmj test/unboxed_crash.cmi test/unboxed_crash.cmj test/unboxed_use_case.cmi test/unboxed_use_case.cmj test/uncurried_cast.cmi test/uncurried_cast.cmj test/uncurried_default.args.cmi test/uncurried_default.args.cmj test/uncurried_pipe.cmi test/uncurried_pipe.cmj test/uncurry_external_test.cmi test/uncurry_external_test.cmj test/uncurry_glob_test.cmi test/uncurry_glob_test.cmj test/uncurry_method.cmi test/uncurry_method.cmj test/uncurry_test.cmi test/uncurry_test.cmj test/undef_regression2_test.cmi test/undef_regression2_test.cmj test/undef_regression_test.cmi test/undef_regression_test.cmj test/undefine_conditional.cmi test/undefine_conditional.cmj test/unicode_type_error.cmi test/unicode_type_error.cmj test/unit_undefined_test.cmi test/unit_undefined_test.cmj test/unitest_string.cmi test/unitest_string.cmj test/unsafe_full_apply_primitive.cmi test/unsafe_full_apply_primitive.cmj test/unsafe_obj_external.cmi test/unsafe_obj_external.cmj test/unsafe_ppx_test.cmi test/unsafe_ppx_test.cmj test/unsafe_this.cmi test/unsafe_this.cmj test/update_record_test.cmi test/update_record_test.cmj test/utf8_decode_test.cmi test/utf8_decode_test.cmj test/variant.cmi test/variant.cmj test/watch_test.cmi test/watch_test.cmj test/webpack_config.cmi test/webpack_config.cmj +o test : phony test/406_primitive_test.cmi test/406_primitive_test.cmj test/EmptyRecord.cmi test/EmptyRecord.cmj test/SafePromises.cmi test/SafePromises.cmj test/UncurriedExternals.cmi test/UncurriedExternals.cmj test/a.cmi test/a.cmj test/a_filename_test.cmi test/a_filename_test.cmj test/a_list_test.cmi test/a_list_test.cmj test/a_recursive_type.cmi test/a_recursive_type.cmj test/a_scope_bug.cmi test/a_scope_bug.cmj test/a_string_test.cmi test/a_string_test.cmj test/abstract_type.cmi test/abstract_type.cmj test/adt_optimize_test.cmi test/adt_optimize_test.cmj test/alias_test.cmi test/alias_test.cmj test/and_or_tailcall_test.cmi test/and_or_tailcall_test.cmj test/app_root_finder.cmi test/app_root_finder.cmj test/argv_test.cmi test/argv_test.cmj test/ari_regress_test.cmi test/ari_regress_test.cmj test/arith_lexer.cmi test/arith_lexer.cmj test/arith_parser.cmi test/arith_parser.cmj test/arith_syntax.cmi test/arith_syntax.cmj test/arity.cmi test/arity.cmj test/arity_deopt.cmi test/arity_deopt.cmj test/arity_infer.cmi test/arity_infer.cmj test/array_data_util.cmi test/array_data_util.cmj test/array_safe_get.cmi test/array_safe_get.cmj test/array_subtle_test.cmi test/array_subtle_test.cmj test/array_test.cmi test/array_test.cmj test/ast_abstract_test.cmi test/ast_abstract_test.cmj test/ast_js_mapper_poly_test.cmi test/ast_js_mapper_poly_test.cmj test/ast_js_mapper_test.cmi test/ast_js_mapper_test.cmj test/ast_mapper_defensive_test.cmi test/ast_mapper_defensive_test.cmj test/ast_mapper_unused_warning_test.cmi test/ast_mapper_unused_warning_test.cmj test/async_ideas.cmi test/async_ideas.cmj test/async_inline.cmi test/async_inline.cmj test/attr_test.cmi test/attr_test.cmj test/b.cmi test/b.cmj test/bal_set_mini.cmi test/bal_set_mini.cmj test/bang_primitive.cmi test/bang_primitive.cmj test/basic_module_test.cmi test/basic_module_test.cmj test/bb.cmi test/bb.cmj test/bdd.cmi test/bdd.cmj test/belt_internal_test.cmi test/belt_internal_test.cmj test/belt_result_alias_test.cmi test/belt_result_alias_test.cmj test/bench.cmi test/bench.cmj test/big_enum.cmi test/big_enum.cmj test/big_polyvar_test.cmi test/big_polyvar_test.cmj test/block_alias_test.cmi test/block_alias_test.cmj test/boolean_test.cmi test/boolean_test.cmj test/bs_MapInt_test.cmi test/bs_MapInt_test.cmj test/bs_abstract_test.cmi test/bs_abstract_test.cmj test/bs_array_test.cmi test/bs_array_test.cmj test/bs_auto_uncurry.cmi test/bs_auto_uncurry.cmj test/bs_auto_uncurry_test.cmi test/bs_auto_uncurry_test.cmj test/bs_float_test.cmi test/bs_float_test.cmj test/bs_hashmap_test.cmi test/bs_hashmap_test.cmj test/bs_hashset_int_test.cmi test/bs_hashset_int_test.cmj test/bs_hashtbl_string_test.cmi test/bs_hashtbl_string_test.cmj test/bs_ignore_effect.cmi test/bs_ignore_effect.cmj test/bs_ignore_test.cmi test/bs_ignore_test.cmj test/bs_int_test.cmi test/bs_int_test.cmj test/bs_list_test.cmi test/bs_list_test.cmj test/bs_map_set_dict_test.cmi test/bs_map_set_dict_test.cmj test/bs_map_test.cmi test/bs_map_test.cmj test/bs_min_max_test.cmi test/bs_min_max_test.cmj test/bs_mutable_set_test.cmi test/bs_mutable_set_test.cmj test/bs_node_string_buffer_test.cmi test/bs_node_string_buffer_test.cmj test/bs_poly_map_test.cmi test/bs_poly_map_test.cmj test/bs_poly_mutable_map_test.cmi test/bs_poly_mutable_map_test.cmj test/bs_poly_mutable_set_test.cmi test/bs_poly_mutable_set_test.cmj test/bs_poly_set_test.cmi test/bs_poly_set_test.cmj test/bs_qualified.cmi test/bs_qualified.cmj test/bs_queue_test.cmi test/bs_queue_test.cmj test/bs_rbset_int_bench.cmi test/bs_rbset_int_bench.cmj test/bs_rest_test.cmi test/bs_rest_test.cmj test/bs_set_bench.cmi test/bs_set_bench.cmj test/bs_set_int_test.cmi test/bs_set_int_test.cmj test/bs_sort_test.cmi test/bs_sort_test.cmj test/bs_splice_partial.cmi test/bs_splice_partial.cmj test/bs_stack_test.cmi test/bs_stack_test.cmj test/bs_string_test.cmi test/bs_string_test.cmj test/bs_unwrap_test.cmi test/bs_unwrap_test.cmj test/buffer_test.cmi test/buffer_test.cmj test/bytes_split_gpr_743_test.cmi test/bytes_split_gpr_743_test.cmj test/caml_compare_test.cmi test/caml_compare_test.cmj test/caml_format_test.cmi test/caml_format_test.cmj test/caml_sys_poly_fill_test.cmi test/caml_sys_poly_fill_test.cmj test/chain_code_test.cmi test/chain_code_test.cmj test/chn_test.cmi test/chn_test.cmj test/class_setter_getter.cmi test/class_setter_getter.cmj test/class_type_ffi_test.cmi test/class_type_ffi_test.cmj test/coercion_module_alias_test.cmi test/coercion_module_alias_test.cmj test/compare_test.cmi test/compare_test.cmj test/complete_parmatch_test.cmi test/complete_parmatch_test.cmj test/complex_if_test.cmi test/complex_if_test.cmj test/complex_test.cmi test/complex_test.cmj test/complex_while_loop.cmi test/complex_while_loop.cmj test/condition_compilation_test.cmi test/condition_compilation_test.cmj test/config1_test.cmi test/config1_test.cmj test/config2_test.cmi test/config2_test.cmj test/console_log_test.cmi test/console_log_test.cmj test/const_block_test.cmi test/const_block_test.cmj test/const_defs.cmi test/const_defs.cmj test/const_defs_test.cmi test/const_defs_test.cmj test/const_test.cmi test/const_test.cmj test/cont_int_fold_test.cmi test/cont_int_fold_test.cmj test/cps_test.cmi test/cps_test.cmj test/cross_module_inline_test.cmi test/cross_module_inline_test.cmj test/custom_error_test.cmi test/custom_error_test.cmj test/debug_keep_test.cmi test/debug_keep_test.cmj test/debug_mode_value.cmi test/debug_mode_value.cmj test/debug_tmp.cmi test/debug_tmp.cmj test/debugger_test.cmi test/debugger_test.cmj test/default_export_test.cmi test/default_export_test.cmj test/defunctor_make_test.cmi test/defunctor_make_test.cmj test/demo.cmi test/demo.cmj test/demo_binding.cmi test/demo_binding.cmj test/demo_int_map.cmi test/demo_int_map.cmj test/demo_page.cmi test/demo_page.cmj test/demo_pipe.cmi test/demo_pipe.cmj test/derive_dyntype.cmi test/derive_dyntype.cmj test/derive_projector_test.cmi test/derive_projector_test.cmj test/derive_type_test.cmi test/derive_type_test.cmj test/digest_test.cmi test/digest_test.cmj test/div_by_zero_test.cmi test/div_by_zero_test.cmj test/dollar_escape_test.cmi test/dollar_escape_test.cmj test/earger_curry_test.cmi test/earger_curry_test.cmj test/effect.cmi test/effect.cmj test/epsilon_test.cmi test/epsilon_test.cmj test/equal_box_test.cmi test/equal_box_test.cmj test/equal_exception_test.cmi test/equal_exception_test.cmj test/equal_test.cmi test/equal_test.cmj test/es6_export.cmi test/es6_export.cmj test/es6_import.cmi test/es6_import.cmj test/es6_module_test.cmi test/es6_module_test.cmj test/escape_esmodule.cmi test/escape_esmodule.cmj test/esmodule_ref.cmi test/esmodule_ref.cmj test/event_ffi.cmi test/event_ffi.cmj test/exception_alias.cmi test/exception_alias.cmj test/exception_def.cmi test/exception_def.cmj test/exception_raise_test.cmi test/exception_raise_test.cmj test/exception_rebind_test.cmi test/exception_rebind_test.cmj test/exception_rebound_err_test.cmi test/exception_rebound_err_test.cmj test/exception_repr_test.cmi test/exception_repr_test.cmj test/exception_value_test.cmi test/exception_value_test.cmj test/exn_error_pattern.cmi test/exn_error_pattern.cmj test/export_keyword.cmi test/export_keyword.cmj test/ext_array_test.cmi test/ext_array_test.cmj test/ext_bytes_test.cmi test/ext_bytes_test.cmj test/ext_filename_test.cmi test/ext_filename_test.cmj test/ext_list_test.cmi test/ext_list_test.cmj test/ext_pervasives_test.cmi test/ext_pervasives_test.cmj test/ext_string_test.cmi test/ext_string_test.cmj test/ext_sys_test.cmi test/ext_sys_test.cmj test/extensible_variant_test.cmi test/extensible_variant_test.cmj test/external_polyfill_test.cmi test/external_polyfill_test.cmj test/external_ppx.cmi test/external_ppx.cmj test/external_ppx2.cmi test/external_ppx2.cmj test/fail_comp.cmi test/fail_comp.cmj test/ffi_arity_test.cmi test/ffi_arity_test.cmj test/ffi_array_test.cmi test/ffi_array_test.cmj test/ffi_js_test.cmi test/ffi_js_test.cmj test/ffi_splice_test.cmi test/ffi_splice_test.cmj test/ffi_test.cmi test/ffi_test.cmj test/fib.cmi test/fib.cmj test/flattern_order_test.cmi test/flattern_order_test.cmj test/flexible_array_test.cmi test/flexible_array_test.cmj test/float_array.cmi test/float_array.cmj test/float_of_bits_test.cmi test/float_of_bits_test.cmj test/float_record.cmi test/float_record.cmj test/float_test.cmi test/float_test.cmj test/floatarray_test.cmi test/floatarray_test.cmj test/flow_parser_reg_test.cmi test/flow_parser_reg_test.cmj test/for_loop_test.cmi test/for_loop_test.cmj test/for_side_effect_test.cmi test/for_side_effect_test.cmj test/format_regression.cmi test/format_regression.cmj test/format_test.cmi test/format_test.cmj test/fs_test.cmi test/fs_test.cmj test/fun_pattern_match.cmi test/fun_pattern_match.cmj test/functor_app_test.cmi test/functor_app_test.cmj test/functor_def.cmi test/functor_def.cmj test/functor_ffi.cmi test/functor_ffi.cmj test/functor_inst.cmi test/functor_inst.cmj test/functors.cmi test/functors.cmj test/gbk.cmi test/gbk.cmj test/genlex_test.cmi test/genlex_test.cmj test/gentTypeReTest.cmi test/gentTypeReTest.cmj test/global_exception_regression_test.cmi test/global_exception_regression_test.cmj test/global_mangles.cmi test/global_mangles.cmj test/global_module_alias_test.cmi test/global_module_alias_test.cmj test/google_closure_test.cmi test/google_closure_test.cmj test/gpr496_test.cmi test/gpr496_test.cmj test/gpr_1063_test.cmi test/gpr_1063_test.cmj test/gpr_1072.cmi test/gpr_1072.cmj test/gpr_1072_reg.cmi test/gpr_1072_reg.cmj test/gpr_1150.cmi test/gpr_1150.cmj test/gpr_1154_test.cmi test/gpr_1154_test.cmj test/gpr_1170.cmi test/gpr_1170.cmj test/gpr_1240_missing_unbox.cmi test/gpr_1240_missing_unbox.cmj test/gpr_1245_test.cmi test/gpr_1245_test.cmj test/gpr_1268.cmi test/gpr_1268.cmj test/gpr_1409_test.cmi test/gpr_1409_test.cmj test/gpr_1423_app_test.cmi test/gpr_1423_app_test.cmj test/gpr_1423_nav.cmi test/gpr_1423_nav.cmj test/gpr_1438.cmi test/gpr_1438.cmj test/gpr_1481.cmi test/gpr_1481.cmj test/gpr_1484.cmi test/gpr_1484.cmj test/gpr_1501_test.cmi test/gpr_1501_test.cmj test/gpr_1503_test.cmi test/gpr_1503_test.cmj test/gpr_1539_test.cmi test/gpr_1539_test.cmj test/gpr_1658_test.cmi test/gpr_1658_test.cmj test/gpr_1667_test.cmi test/gpr_1667_test.cmj test/gpr_1692_test.cmi test/gpr_1692_test.cmj test/gpr_1698_test.cmi test/gpr_1698_test.cmj test/gpr_1701_test.cmi test/gpr_1701_test.cmj test/gpr_1716_test.cmi test/gpr_1716_test.cmj test/gpr_1717_test.cmi test/gpr_1717_test.cmj test/gpr_1728_test.cmi test/gpr_1728_test.cmj test/gpr_1749_test.cmi test/gpr_1749_test.cmj test/gpr_1759_test.cmi test/gpr_1759_test.cmj test/gpr_1760_test.cmi test/gpr_1760_test.cmj test/gpr_1762_test.cmi test/gpr_1762_test.cmj test/gpr_1817_test.cmi test/gpr_1817_test.cmj test/gpr_1822_test.cmi test/gpr_1822_test.cmj test/gpr_1891_test.cmi test/gpr_1891_test.cmj test/gpr_1943_test.cmi test/gpr_1943_test.cmj test/gpr_1946_test.cmi test/gpr_1946_test.cmj test/gpr_2316_test.cmi test/gpr_2316_test.cmj test/gpr_2352_test.cmi test/gpr_2352_test.cmj test/gpr_2413_test.cmi test/gpr_2413_test.cmj test/gpr_2474.cmi test/gpr_2474.cmj test/gpr_2487.cmi test/gpr_2487.cmj test/gpr_2503_test.cmi test/gpr_2503_test.cmj test/gpr_2608_test.cmi test/gpr_2608_test.cmj test/gpr_2614_test.cmi test/gpr_2614_test.cmj test/gpr_2633_test.cmi test/gpr_2633_test.cmj test/gpr_2642_test.cmi test/gpr_2642_test.cmj test/gpr_2652_test.cmi test/gpr_2652_test.cmj test/gpr_2682_test.cmi test/gpr_2682_test.cmj test/gpr_2700_test.cmi test/gpr_2700_test.cmj test/gpr_2731_test.cmi test/gpr_2731_test.cmj test/gpr_2789_test.cmi test/gpr_2789_test.cmj test/gpr_2931_test.cmi test/gpr_2931_test.cmj test/gpr_3142_test.cmi test/gpr_3142_test.cmj test/gpr_3154_test.cmi test/gpr_3154_test.cmj test/gpr_3209_test.cmi test/gpr_3209_test.cmj test/gpr_3492_test.cmi test/gpr_3492_test.cmj test/gpr_3519_jsx_test.cmi test/gpr_3519_jsx_test.cmj test/gpr_3519_test.cmi test/gpr_3519_test.cmj test/gpr_3536_test.cmi test/gpr_3536_test.cmj test/gpr_3546_test.cmi test/gpr_3546_test.cmj test/gpr_3548_test.cmi test/gpr_3548_test.cmj test/gpr_3549_test.cmi test/gpr_3549_test.cmj test/gpr_3566_drive_test.cmi test/gpr_3566_drive_test.cmj test/gpr_3566_test.cmi test/gpr_3566_test.cmj test/gpr_3595_test.cmi test/gpr_3595_test.cmj test/gpr_3609_test.cmi test/gpr_3609_test.cmj test/gpr_3697_test.cmi test/gpr_3697_test.cmj test/gpr_373_test.cmi test/gpr_373_test.cmj test/gpr_3770_test.cmi test/gpr_3770_test.cmj test/gpr_3852_alias.cmi test/gpr_3852_alias.cmj test/gpr_3852_alias_reify.cmi test/gpr_3852_alias_reify.cmj test/gpr_3852_effect.cmi test/gpr_3852_effect.cmj test/gpr_3865.cmi test/gpr_3865.cmj test/gpr_3865_bar.cmi test/gpr_3865_bar.cmj test/gpr_3865_foo.cmi test/gpr_3865_foo.cmj test/gpr_3875_test.cmi test/gpr_3875_test.cmj test/gpr_3877_test.cmi test/gpr_3877_test.cmj test/gpr_3895_test.cmi test/gpr_3895_test.cmj test/gpr_3897_test.cmi test/gpr_3897_test.cmj test/gpr_3931_test.cmi test/gpr_3931_test.cmj test/gpr_3980_test.cmi test/gpr_3980_test.cmj test/gpr_4025_test.cmi test/gpr_4025_test.cmj test/gpr_405_test.cmi test/gpr_405_test.cmj test/gpr_4069_test.cmi test/gpr_4069_test.cmj test/gpr_4265_test.cmi test/gpr_4265_test.cmj test/gpr_4274_test.cmi test/gpr_4274_test.cmj test/gpr_4280_test.cmi test/gpr_4280_test.cmj test/gpr_4407_test.cmi test/gpr_4407_test.cmj test/gpr_441.cmi test/gpr_441.cmj test/gpr_4442_test.cmi test/gpr_4442_test.cmj test/gpr_4491_test.cmi test/gpr_4491_test.cmj test/gpr_4494_test.cmi test/gpr_4494_test.cmj test/gpr_4519_test.cmi test/gpr_4519_test.cmj test/gpr_459_test.cmi test/gpr_459_test.cmj test/gpr_4632.cmi test/gpr_4632.cmj test/gpr_4639_test.cmi test/gpr_4639_test.cmj test/gpr_4900_test.cmi test/gpr_4900_test.cmj test/gpr_4924_test.cmi test/gpr_4924_test.cmj test/gpr_4931.cmi test/gpr_4931.cmj test/gpr_4931_allow.cmi test/gpr_4931_allow.cmj test/gpr_5071_test.cmi test/gpr_5071_test.cmj test/gpr_5169_test.cmi test/gpr_5169_test.cmj test/gpr_5218_test.cmi test/gpr_5218_test.cmj test/gpr_5280_optimize_test.cmi test/gpr_5280_optimize_test.cmj test/gpr_5312.cmi test/gpr_5312.cmj test/gpr_5557.cmi test/gpr_5557.cmj test/gpr_5753.cmi test/gpr_5753.cmj test/gpr_658.cmi test/gpr_658.cmj test/gpr_858_test.cmi test/gpr_858_test.cmj test/gpr_858_unit2_test.cmi test/gpr_858_unit2_test.cmj test/gpr_904_test.cmi test/gpr_904_test.cmj test/gpr_974_test.cmi test/gpr_974_test.cmj test/gpr_977_test.cmi test/gpr_977_test.cmj test/gpr_return_type_unused_attribute.cmi test/gpr_return_type_unused_attribute.cmj test/gray_code_test.cmi test/gray_code_test.cmj test/guide_for_ext.cmi test/guide_for_ext.cmj test/hamming_test.cmi test/hamming_test.cmj test/hash_collision_test.cmi test/hash_collision_test.cmj test/hash_sugar_desugar.cmi test/hash_sugar_desugar.cmj test/hash_test.cmi test/hash_test.cmj test/hashtbl_test.cmi test/hashtbl_test.cmj test/hello.foo.cmi test/hello.foo.cmj test/hello_res.cmi test/hello_res.cmj test/http_types.cmi test/http_types.cmj test/ignore_test.cmi test/ignore_test.cmj test/imm_map_bench.cmi test/imm_map_bench.cmj test/include_side_effect.cmi test/include_side_effect.cmj test/include_side_effect_free.cmi test/include_side_effect_free.cmj test/incomplete_toplevel_test.cmi test/incomplete_toplevel_test.cmj test/infer_type_test.cmi test/infer_type_test.cmj test/inline_const.cmi test/inline_const.cmj test/inline_const_test.cmi test/inline_const_test.cmj test/inline_edge_cases.cmi test/inline_edge_cases.cmj test/inline_map2_test.cmi test/inline_map2_test.cmj test/inline_map_demo.cmi test/inline_map_demo.cmj test/inline_map_test.cmi test/inline_map_test.cmj test/inline_record_test.cmi test/inline_record_test.cmj test/inline_regression_test.cmi test/inline_regression_test.cmj test/inline_string_test.cmi test/inline_string_test.cmj test/inner_call.cmi test/inner_call.cmj test/inner_define.cmi test/inner_define.cmj test/inner_unused.cmi test/inner_unused.cmj test/installation_test.cmi test/installation_test.cmj test/int32_test.cmi test/int32_test.cmj test/int64_mul_div_test.cmi test/int64_mul_div_test.cmj test/int64_string_bench.cmi test/int64_string_bench.cmj test/int64_string_test.cmi test/int64_string_test.cmj test/int64_test.cmi test/int64_test.cmj test/int_hashtbl_test.cmi test/int_hashtbl_test.cmj test/int_map.cmi test/int_map.cmj test/int_overflow_test.cmi test/int_overflow_test.cmj test/int_poly_var.cmi test/int_poly_var.cmj test/int_switch_test.cmi test/int_switch_test.cmj test/internal_unused_test.cmi test/internal_unused_test.cmj test/io_test.cmi test/io_test.cmj test/js_array_test.cmi test/js_array_test.cmj test/js_bool_test.cmi test/js_bool_test.cmj test/js_cast_test.cmi test/js_cast_test.cmj test/js_date_test.cmi test/js_date_test.cmj test/js_dict_test.cmi test/js_dict_test.cmj test/js_exception_catch_test.cmi test/js_exception_catch_test.cmj test/js_float_test.cmi test/js_float_test.cmj test/js_global_test.cmi test/js_global_test.cmj test/js_int_test.cmi test/js_int_test.cmj test/js_json_test.cmi test/js_json_test.cmj test/js_list_test.cmi test/js_list_test.cmj test/js_math_test.cmi test/js_math_test.cmj test/js_null_test.cmi test/js_null_test.cmj test/js_null_undefined_test.cmi test/js_null_undefined_test.cmj test/js_nullable_test.cmi test/js_nullable_test.cmj test/js_obj_test.cmi test/js_obj_test.cmj test/js_option_test.cmi test/js_option_test.cmj test/js_promise_basic_test.cmi test/js_promise_basic_test.cmj test/js_re_test.cmi test/js_re_test.cmj test/js_string_test.cmi test/js_string_test.cmj test/js_typed_array_test.cmi test/js_typed_array_test.cmj test/js_undefined_test.cmi test/js_undefined_test.cmj test/js_val.cmi test/js_val.cmj test/jsoo_400_test.cmi test/jsoo_400_test.cmj test/jsoo_485_test.cmi test/jsoo_485_test.cmj test/key_word_property.cmi test/key_word_property.cmj test/key_word_property2.cmi test/key_word_property2.cmj test/key_word_property_plus_test.cmi test/key_word_property_plus_test.cmj test/label_uncurry.cmi test/label_uncurry.cmj test/large_integer_pat.cmi test/large_integer_pat.cmj test/large_record_duplication_test.cmi test/large_record_duplication_test.cmj test/largest_int_flow.cmi test/largest_int_flow.cmj test/lazy_demo.cmi test/lazy_demo.cmj test/lazy_test.cmi test/lazy_test.cmj test/lexer_test.cmi test/lexer_test.cmj test/lib_js_test.cmi test/lib_js_test.cmj test/libarg_test.cmi test/libarg_test.cmj test/libqueue_test.cmi test/libqueue_test.cmj test/limits_test.cmi test/limits_test.cmj test/list_stack.cmi test/list_stack.cmj test/list_test.cmi test/list_test.cmj test/local_class_type.cmi test/local_class_type.cmj test/local_exception_test.cmi test/local_exception_test.cmj test/loop_regression_test.cmi test/loop_regression_test.cmj test/loop_suites_test.cmi test/loop_suites_test.cmj test/map_find_test.cmi test/map_find_test.cmj test/map_test.cmi test/map_test.cmj test/mario_game.cmi test/mario_game.cmj test/marshal.cmi test/marshal.cmj test/method_chain.cmi test/method_chain.cmj test/method_name_test.cmi test/method_name_test.cmj test/method_string_name.cmi test/method_string_name.cmj test/minimal_test.cmi test/minimal_test.cmj test/miss_colon_test.cmi test/miss_colon_test.cmj test/mock_mt.cmi test/mock_mt.cmj test/module_alias_test.cmi test/module_alias_test.cmj test/module_as_class_ffi.cmi test/module_as_class_ffi.cmj test/module_as_function.cmi test/module_as_function.cmj test/module_missing_conversion.cmi test/module_missing_conversion.cmj test/module_parameter_test.cmi test/module_parameter_test.cmj test/module_splice_test.cmi test/module_splice_test.cmj test/more_poly_variant_test.cmi test/more_poly_variant_test.cmj test/more_uncurry.cmi test/more_uncurry.cmj test/mpr_6033_test.cmi test/mpr_6033_test.cmj test/mt.cmi test/mt.cmj test/mt_global.cmi test/mt_global.cmj test/mutable_obj_test.cmi test/mutable_obj_test.cmj test/mutable_uncurry_test.cmi test/mutable_uncurry_test.cmj test/mutual_non_recursive_type.cmi test/mutual_non_recursive_type.cmj test/name_mangle_test.cmi test/name_mangle_test.cmj test/nested_include.cmi test/nested_include.cmj test/nested_module_alias.cmi test/nested_module_alias.cmj test/nested_obj_literal.cmi test/nested_obj_literal.cmj test/nested_obj_test.cmi test/nested_obj_test.cmj test/nested_pattern_match_test.cmi test/nested_pattern_match_test.cmj test/noassert.cmi test/noassert.cmj test/node_fs_test.cmi test/node_fs_test.cmj test/node_path_test.cmi test/node_path_test.cmj test/null_list_test.cmi test/null_list_test.cmj test/number_lexer.cmi test/number_lexer.cmj test/obj_literal_ppx.cmi test/obj_literal_ppx.cmj test/obj_literal_ppx_test.cmi test/obj_literal_ppx_test.cmj test/obj_magic_test.cmi test/obj_magic_test.cmj test/obj_type_test.cmi test/obj_type_test.cmj test/ocaml_re_test.cmi test/ocaml_re_test.cmj test/of_string_test.cmi test/of_string_test.cmj test/offset.cmi test/offset.cmj test/oo_js_test_date.cmi test/oo_js_test_date.cmj test/option_encoding_test.cmi test/option_encoding_test.cmj test/option_record_none_test.cmi test/option_record_none_test.cmj test/option_repr_test.cmi test/option_repr_test.cmj test/optional_ffi_test.cmi test/optional_ffi_test.cmj test/optional_regression_test.cmi test/optional_regression_test.cmj test/pipe_send_readline.cmi test/pipe_send_readline.cmj test/pipe_syntax.cmi test/pipe_syntax.cmj test/poly_empty_array.cmi test/poly_empty_array.cmj test/poly_type.cmi test/poly_type.cmj test/poly_variant_test.cmi test/poly_variant_test.cmj test/polymorphic_raw_test.cmi test/polymorphic_raw_test.cmj test/polymorphism_test.cmi test/polymorphism_test.cmj test/polyvar_convert.cmi test/polyvar_convert.cmj test/polyvar_test.cmi test/polyvar_test.cmj test/ppx_apply_test.cmi test/ppx_apply_test.cmj test/pq_test.cmi test/pq_test.cmj test/pr6726.cmi test/pr6726.cmj test/pr_regression_test.cmi test/pr_regression_test.cmj test/prepend_data_ffi.cmi test/prepend_data_ffi.cmj test/primitive_reg_test.cmi test/primitive_reg_test.cmj test/print_alpha_test.cmi test/print_alpha_test.cmj test/promise.cmi test/promise.cmj test/promise_catch_test.cmi test/promise_catch_test.cmj test/queue_402.cmi test/queue_402.cmj test/queue_test.cmi test/queue_test.cmj test/random_test.cmi test/random_test.cmj test/raw_hash_tbl_bench.cmi test/raw_hash_tbl_bench.cmj test/raw_output_test.cmi test/raw_output_test.cmj test/raw_pure_test.cmi test/raw_pure_test.cmj test/rbset.cmi test/rbset.cmj test/react.cmi test/react.cmj test/reactDOMRe.cmi test/reactDOMRe.cmj test/reactDOMServerRe.cmi test/reactDOMServerRe.cmj test/reactEvent.cmi test/reactEvent.cmj test/reactTestUtils.cmi test/reactTestUtils.cmj test/reasonReact.cmi test/reasonReact.cmj test/reasonReactCompat.cmi test/reasonReactCompat.cmj test/reasonReactOptimizedCreateClass.cmi test/reasonReactOptimizedCreateClass.cmj test/reasonReactRouter.cmi test/reasonReactRouter.cmj test/rebind_module.cmi test/rebind_module.cmj test/rebind_module_test.cmi test/rebind_module_test.cmj test/rec_array_test.cmi test/rec_array_test.cmj test/rec_fun_test.cmi test/rec_fun_test.cmj test/rec_module_opt.cmi test/rec_module_opt.cmj test/rec_module_test.cmi test/rec_module_test.cmj test/rec_value_test.cmi test/rec_value_test.cmj test/record_debug_test.cmi test/record_debug_test.cmj test/record_extension_test.cmi test/record_extension_test.cmj test/record_name_test.cmi test/record_name_test.cmj test/record_regression.cmi test/record_regression.cmj test/record_with_test.cmi test/record_with_test.cmj test/recursive_module.cmi test/recursive_module.cmj test/recursive_module_test.cmi test/recursive_module_test.cmj test/recursive_react_component.cmi test/recursive_react_component.cmj test/recursive_records_test.cmi test/recursive_records_test.cmj test/recursive_unbound_module_test.cmi test/recursive_unbound_module_test.cmj test/regression_print.cmi test/regression_print.cmj test/relative_path.cmi test/relative_path.cmj test/res_debug.cmi test/res_debug.cmj test/return_check.cmi test/return_check.cmj test/runtime_encoding_test.cmi test/runtime_encoding_test.cmj test/set_gen.cmi test/set_gen.cmj test/sexp.cmi test/sexp.cmj test/sexpm.cmi test/sexpm.cmj test/sexpm_test.cmi test/sexpm_test.cmj test/side_effect.cmi test/side_effect.cmj test/side_effect_free.cmi test/side_effect_free.cmj test/simple_derive_test.cmi test/simple_derive_test.cmj test/simple_derive_use.cmi test/simple_derive_use.cmj test/simple_lexer_test.cmi test/simple_lexer_test.cmj test/simplify_lambda_632o.cmi test/simplify_lambda_632o.cmj test/single_module_alias.cmi test/single_module_alias.cmj test/singular_unit_test.cmi test/singular_unit_test.cmj test/small_inline_test.cmi test/small_inline_test.cmj test/splice_test.cmi test/splice_test.cmj test/stack_comp_test.cmi test/stack_comp_test.cmj test/stack_test.cmi test/stack_test.cmj test/stream_parser_test.cmi test/stream_parser_test.cmj test/string_bound_get_test.cmi test/string_bound_get_test.cmj test/string_get_set_test.cmi test/string_get_set_test.cmj test/string_interp_test.cmi test/string_interp_test.cmj test/string_literal_print_test.cmi test/string_literal_print_test.cmj test/string_runtime_test.cmi test/string_runtime_test.cmj test/string_set.cmi test/string_set.cmj test/string_set_test.cmi test/string_set_test.cmj test/string_test.cmi test/string_test.cmj test/string_unicode_test.cmi test/string_unicode_test.cmj test/stringmatch_test.cmi test/stringmatch_test.cmj test/submodule.cmi test/submodule.cmj test/submodule_call.cmi test/submodule_call.cmj test/switch_case_test.cmi test/switch_case_test.cmj test/tailcall_inline_test.cmi test/tailcall_inline_test.cmj test/template.cmi test/template.cmj test/test.cmi test/test.cmj test/test2.cmi test/test2.cmj test/test_alias.cmi test/test_alias.cmj test/test_ari.cmi test/test_ari.cmj test/test_array.cmi test/test_array.cmj test/test_array_append.cmi test/test_array_append.cmj test/test_array_primitive.cmi test/test_array_primitive.cmj test/test_bool_equal.cmi test/test_bool_equal.cmj test/test_bs_this.cmi test/test_bs_this.cmj test/test_bug.cmi test/test_bug.cmj test/test_bytes.cmi test/test_bytes.cmj test/test_case_opt_collision.cmi test/test_case_opt_collision.cmj test/test_case_set.cmi test/test_case_set.cmj test/test_char.cmi test/test_char.cmj test/test_closure.cmi test/test_closure.cmj test/test_common.cmi test/test_common.cmj test/test_const_elim.cmi test/test_const_elim.cmj test/test_const_propogate.cmi test/test_const_propogate.cmj test/test_cpp.cmi test/test_cpp.cmj test/test_cps.cmi test/test_cps.cmj test/test_demo.cmi test/test_demo.cmj test/test_dup_param.cmi test/test_dup_param.cmj test/test_eq.cmi test/test_eq.cmj test/test_exception.cmi test/test_exception.cmj test/test_exception_escape.cmi test/test_exception_escape.cmj test/test_export2.cmi test/test_export2.cmj test/test_external.cmi test/test_external.cmj test/test_external_unit.cmi test/test_external_unit.cmj test/test_ffi.cmi test/test_ffi.cmj test/test_fib.cmi test/test_fib.cmj test/test_filename.cmi test/test_filename.cmj test/test_for_loop.cmi test/test_for_loop.cmj test/test_for_map.cmi test/test_for_map.cmj test/test_for_map2.cmi test/test_for_map2.cmj test/test_format.cmi test/test_format.cmj test/test_formatter.cmi test/test_formatter.cmj test/test_functor_dead_code.cmi test/test_functor_dead_code.cmj test/test_generative_module.cmi test/test_generative_module.cmj test/test_global_print.cmi test/test_global_print.cmj test/test_google_closure.cmi test/test_google_closure.cmj test/test_http_server.cmi test/test_http_server.cmj test/test_include.cmi test/test_include.cmj test/test_incomplete.cmi test/test_incomplete.cmj test/test_incr_ref.cmi test/test_incr_ref.cmj test/test_index.cmi test/test_index.cmj test/test_int_map_find.cmi test/test_int_map_find.cmj test/test_internalOO.cmi test/test_internalOO.cmj test/test_is_js.cmi test/test_is_js.cmj test/test_js_ffi.cmi test/test_js_ffi.cmj test/test_let.cmi test/test_let.cmj test/test_list.cmi test/test_list.cmj test/test_literal.cmi test/test_literal.cmj test/test_literals.cmi test/test_literals.cmj test/test_match_exception.cmi test/test_match_exception.cmj test/test_mutliple.cmi test/test_mutliple.cmj test/test_nat64.cmi test/test_nat64.cmj test/test_nested_let.cmi test/test_nested_let.cmj test/test_nested_print.cmi test/test_nested_print.cmj test/test_non_export.cmi test/test_non_export.cmj test/test_nullary.cmi test/test_nullary.cmj test/test_obj.cmi test/test_obj.cmj test/test_obj_simple_ffi.cmi test/test_obj_simple_ffi.cmj test/test_order.cmi test/test_order.cmj test/test_order_tailcall.cmi test/test_order_tailcall.cmj test/test_other_exn.cmi test/test_other_exn.cmj test/test_pack.cmi test/test_pack.cmj test/test_per.cmi test/test_per.cmj test/test_pervasive.cmi test/test_pervasive.cmj test/test_pervasives2.cmi test/test_pervasives2.cmj test/test_pervasives3.cmi test/test_pervasives3.cmj test/test_primitive.cmi test/test_primitive.cmj test/test_promise_bind.cmi test/test_promise_bind.cmj test/test_ramification.cmi test/test_ramification.cmj test/test_react.cmi test/test_react.cmj test/test_react_case.cmi test/test_react_case.cmj test/test_regex.cmi test/test_regex.cmj test/test_require.cmi test/test_require.cmj test/test_runtime_encoding.cmi test/test_runtime_encoding.cmj test/test_scope.cmi test/test_scope.cmj test/test_seq.cmi test/test_seq.cmj test/test_set.cmi test/test_set.cmj test/test_side_effect_functor.cmi test/test_side_effect_functor.cmj test/test_simple_include.cmi test/test_simple_include.cmj test/test_simple_pattern_match.cmi test/test_simple_pattern_match.cmj test/test_simple_ref.cmi test/test_simple_ref.cmj test/test_simple_tailcall.cmi test/test_simple_tailcall.cmj test/test_small.cmi test/test_small.cmj test/test_sprintf.cmi test/test_sprintf.cmj test/test_stack.cmi test/test_stack.cmj test/test_static_catch_ident.cmi test/test_static_catch_ident.cmj test/test_string.cmi test/test_string.cmj test/test_string_case.cmi test/test_string_case.cmj test/test_string_const.cmi test/test_string_const.cmj test/test_string_map.cmi test/test_string_map.cmj test/test_string_switch.cmi test/test_string_switch.cmj test/test_switch.cmi test/test_switch.cmj test/test_trywith.cmi test/test_trywith.cmj test/test_tuple.cmi test/test_tuple.cmj test/test_tuple_destructring.cmi test/test_tuple_destructring.cmj test/test_type_based_arity.cmi test/test_type_based_arity.cmj test/test_u.cmi test/test_u.cmj test/test_unknown.cmi test/test_unknown.cmj test/test_unsafe_cmp.cmi test/test_unsafe_cmp.cmj test/test_unsafe_obj_ffi.cmi test/test_unsafe_obj_ffi.cmj test/test_unsafe_obj_ffi_ppx.cmi test/test_unsafe_obj_ffi_ppx.cmj test/test_unsupported_primitive.cmi test/test_unsupported_primitive.cmj test/test_while_closure.cmi test/test_while_closure.cmj test/test_while_side_effect.cmi test/test_while_side_effect.cmj test/test_zero_nullable.cmi test/test_zero_nullable.cmj test/then_mangle_test.cmi test/then_mangle_test.cmj test/ticker.cmi test/ticker.cmj test/to_string_test.cmi test/to_string_test.cmj test/topsort_test.cmi test/topsort_test.cmj test/tramp_fib.cmi test/tramp_fib.cmj test/tuple_alloc.cmi test/tuple_alloc.cmj test/type_disambiguate.cmi test/type_disambiguate.cmj test/typeof_test.cmi test/typeof_test.cmj test/ui_defs.cmi test/unboxed_attribute.cmi test/unboxed_attribute.cmj test/unboxed_attribute_test.cmi test/unboxed_attribute_test.cmj test/unboxed_crash.cmi test/unboxed_crash.cmj test/unboxed_use_case.cmi test/unboxed_use_case.cmj test/uncurried_cast.cmi test/uncurried_cast.cmj test/uncurried_default.args.cmi test/uncurried_default.args.cmj test/uncurried_pipe.cmi test/uncurried_pipe.cmj test/uncurry_external_test.cmi test/uncurry_external_test.cmj test/uncurry_glob_test.cmi test/uncurry_glob_test.cmj test/uncurry_test.cmi test/uncurry_test.cmj test/undef_regression2_test.cmi test/undef_regression2_test.cmj test/undef_regression_test.cmi test/undef_regression_test.cmj test/undefine_conditional.cmi test/undefine_conditional.cmj test/unicode_type_error.cmi test/unicode_type_error.cmj test/unit_undefined_test.cmi test/unit_undefined_test.cmj test/unitest_string.cmi test/unitest_string.cmj test/unsafe_full_apply_primitive.cmi test/unsafe_full_apply_primitive.cmj test/unsafe_obj_external.cmi test/unsafe_obj_external.cmj test/unsafe_ppx_test.cmi test/unsafe_ppx_test.cmj test/unsafe_this.cmi test/unsafe_this.cmj test/update_record_test.cmi test/update_record_test.cmj test/utf8_decode_test.cmi test/utf8_decode_test.cmj test/variant.cmi test/variant.cmj test/watch_test.cmi test/watch_test.cmj test/webpack_config.cmi test/webpack_config.cmj diff --git a/jscomp/test/class_type_ffi_test.js b/jscomp/test/class_type_ffi_test.js index d30c2758c7..a303dc35d7 100644 --- a/jscomp/test/class_type_ffi_test.js +++ b/jscomp/test/class_type_ffi_test.js @@ -66,27 +66,6 @@ function mk_f(param) { }; } -function omk_f(param) { - return { - huge_methdo: (function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { - return Curry.app(a0, [ - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12 - ]); - }) - }; -} - exports.sum_float_array = sum_float_array; exports.sum_int_array = sum_int_array; exports.sum_poly = sum_poly; @@ -96,5 +75,4 @@ exports.ff = ff; exports.ff2 = ff2; exports.off2 = off2; exports.mk_f = mk_f; -exports.omk_f = omk_f; /* No side effect */ diff --git a/jscomp/test/class_type_ffi_test.ml b/jscomp/test/class_type_ffi_test.ml index 484d41b732..372e078b74 100644 --- a/jscomp/test/class_type_ffi_test.ml +++ b/jscomp/test/class_type_ffi_test.ml @@ -68,10 +68,3 @@ let off2 o a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 = let mk_f () = fun [@bs] a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 -> a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 - -(* Test [fn_method] *) -let omk_f ()= - object - method huge_methdo a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 = - a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 -end \ No newline at end of file diff --git a/jscomp/test/ffi_js_test.js b/jscomp/test/ffi_js_test.js index fd77cc6cbd..6a5ee1a859 100644 --- a/jscomp/test/ffi_js_test.js +++ b/jscomp/test/ffi_js_test.js @@ -80,32 +80,16 @@ var same_type = [ same_type_1 ]; -var v_obj = { - hi: (function () { - console.log("hei"); - }) -}; - -eq("File \"ffi_js_test.ml\", line 44, characters 5-12", [ +eq("File \"ffi_js_test.ml\", line 41, characters 5-12", [ Object.keys(int_config).length, 2 ]); -eq("File \"ffi_js_test.ml\", line 45, characters 5-12", [ +eq("File \"ffi_js_test.ml\", line 42, characters 5-12", [ Object.keys(string_config).length, 2 ]); -eq("File \"ffi_js_test.ml\", line 46, characters 5-12", [ - Object.keys(v_obj).indexOf("hi_x"), - -1 - ]); - -eq("File \"ffi_js_test.ml\", line 47, characters 5-12", [ - Object.keys(v_obj).indexOf("hi"), - 0 - ]); - var u = { contents: 3 }; @@ -115,7 +99,7 @@ var side_effect_config = (u.contents = u.contents + 1 | 0, { low: 32 }); -eq("File \"ffi_js_test.ml\", line 54, characters 5-12", [ +eq("File \"ffi_js_test.ml\", line 49, characters 5-12", [ u.contents, 4 ]); @@ -183,7 +167,6 @@ exports.eq = eq; exports.int_config = int_config; exports.string_config = string_config; exports.same_type = same_type; -exports.v_obj = v_obj; exports.u = u; exports.side_effect_config = side_effect_config; exports.vv = vv; diff --git a/jscomp/test/ffi_js_test.ml b/jscomp/test/ffi_js_test.ml index d0a4487fbc..4b7e973769 100644 --- a/jscomp/test/ffi_js_test.ml +++ b/jscomp/test/ffi_js_test.ml @@ -37,14 +37,9 @@ let same_type = [string_config ; [%obj{hi = 3 ; low = "32"}]] ) -let v_obj = object method hi__x () = Js.log "hei" end - - let () = eq __LOC__ (Array.length (Js_obj.keys int_config), 2 ); - eq __LOC__ (Array.length (Js_obj.keys string_config), 2 ); - eq __LOC__ (Js_obj.keys v_obj |. Js.Array2.indexOf "hi_x" , -1 ); - eq __LOC__ (Js_obj.keys v_obj |. Js.Array2.indexOf "hi", 0 ) + eq __LOC__ (Array.length (Js_obj.keys string_config), 2 ) let u = ref 3 diff --git a/jscomp/test/gpr_1600_test.js b/jscomp/test/gpr_1600_test.js deleted file mode 100644 index 00c565ee9c..0000000000 --- a/jscomp/test/gpr_1600_test.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - - -var obj = { - hi: (function (x) { - console.log(x); - }) -}; - -var eventObj = { - events: [], - empty: (function () { - - }), - push: (function (a) { - var self = this ; - self.events[0] = a; - }), - needRebuild: (function () { - var self = this ; - return self.events.length !== 0; - }), - currentEvents: (function () { - var self = this ; - return self.events; - }) -}; - -function f(param) { - return eventObj; -} - -exports.obj = obj; -exports.eventObj = eventObj; -exports.f = f; -/* obj Not a pure module */ diff --git a/jscomp/test/gpr_1600_test.ml b/jscomp/test/gpr_1600_test.ml deleted file mode 100644 index 1203ec0dd8..0000000000 --- a/jscomp/test/gpr_1600_test.ml +++ /dev/null @@ -1,33 +0,0 @@ - - - -let f : (int * int -> int [@bs]) = fun [@bs] x -> let a,b = x in a + b - - -let obj : < hi : (int * int -> unit [@bs.meth]) > = object - method hi (x : int * int) = Js.log x -end -(** expect *) - -class type a = object - method empty : unit -> unit - method currentEvents : unit -> (string * string) array - method push : string * string -> unit - method needRebuild : unit -> bool -end - - - -let eventObj : < currentEvents : (unit -> (string * string) array [@bs.meth]); - empty : (unit -> unit [@bs.meth]); - needRebuild : (unit -> bool [@bs.meth]); - push : (string * string -> unit [@bs.meth]) > - = object(self) - val events : (string * string) array = [||] - method empty () = () - method push a = Array.unsafe_set self##events 0 a - method needRebuild () = Array.length self##events <> 0 - method currentEvents () = self##events -end - -let f () = (eventObj : a) diff --git a/jscomp/test/gpr_627_test.js b/jscomp/test/gpr_627_test.js deleted file mode 100644 index e1c1bb7107..0000000000 --- a/jscomp/test/gpr_627_test.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -var Mt = require("./mt.js"); - -var suites = { - contents: /* [] */0 -}; - -var test_id = { - contents: 0 -}; - -function eq(loc, param) { - var y = param[1]; - var x = param[0]; - test_id.contents = test_id.contents + 1 | 0; - suites.contents = { - hd: [ - loc + (" id " + String(test_id.contents)), - (function (param) { - return { - TAG: /* Eq */0, - _0: x, - _1: y - }; - }) - ], - tl: suites.contents - }; -} - -var u = { - say: (function (x, y) { - return x + y | 0; - }) -}; - -var v = { - hi: (function (x, y) { - var self = this ; - var u = { - x: x - }; - return self.say(u.x) + y + x; - }), - say: (function (x) { - var self = this ; - return x * self.x(); - }), - x: (function () { - return 3; - }) -}; - -var p_1 = u.say(1, 2); - -var p = [ - 3, - p_1 -]; - -eq("File \"gpr_627_test.ml\", line 26, characters 5-12", p); - -eq("File \"gpr_627_test.ml\", line 27, characters 5-12", [ - v.hi(1, 2), - 6 - ]); - -Mt.from_pair_suites("Gpr_627_test", suites.contents); - -exports.suites = suites; -exports.test_id = test_id; -exports.eq = eq; -exports.u = u; -exports.v = v; -/* u Not a pure module */ diff --git a/jscomp/test/gpr_627_test.ml b/jscomp/test/gpr_627_test.ml deleted file mode 100644 index a34687ee36..0000000000 --- a/jscomp/test/gpr_627_test.ml +++ /dev/null @@ -1,31 +0,0 @@ -let suites : Mt.pair_suites ref = ref [] -let test_id = ref 0 -let eq loc (x, y) = - incr test_id ; - suites := - (loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites - - -let u = object - method say x y = x + y -end - -let v = - let x = 3. in - object (self) - method hi x y = - let u = [%bs.obj{ x }] in - self##say u##x +. y +.x - method say = fun x -> x *. self## x () - method x () = x - end - - -let () = - let p = (3, u##say 1 2) in - eq __LOC__ p ; - eq __LOC__ (v##hi 1. 2., 6.) - - -let () = Mt.from_pair_suites __MODULE__ !suites - diff --git a/jscomp/test/mutable_uncurry_test.js b/jscomp/test/mutable_uncurry_test.js index 9515d9e7e8..6f253f27f1 100644 --- a/jscomp/test/mutable_uncurry_test.js +++ b/jscomp/test/mutable_uncurry_test.js @@ -39,22 +39,6 @@ eqs("File \"mutable_uncurry_test.ml\", line 16, characters 7-14", true, eq({ contents: 2 })); -var u = { - hi: (function (param, param$1) { - var x = param.contents; - var y = param$1.contents; - return x === y; - }) -}; - -var h = u.hi({ - contents: 1 - }, { - contents: 2 - }); - -eqs("File \"mutable_uncurry_test.ml\", line 26, characters 7-14", h, false); - function ut3(param, param$1, param$2) { var x0 = param.contents; var x1 = param$1.contents; @@ -195,7 +179,7 @@ function nested1(param) { }; } -eqs("File \"mutable_uncurry_test.ml\", line 56, characters 9-16", ut3({ +eqs("File \"mutable_uncurry_test.ml\", line 46, characters 9-16", ut3({ contents: 1 }, { contents: 2 @@ -207,7 +191,7 @@ eqs("File \"mutable_uncurry_test.ml\", line 56, characters 9-16", ut3({ 3 ]); -eqs("File \"mutable_uncurry_test.ml\", line 57, characters 7-14", Curry._1(t3({ +eqs("File \"mutable_uncurry_test.ml\", line 47, characters 7-14", Curry._1(t3({ contents: 1 })({ contents: 2 @@ -219,7 +203,7 @@ eqs("File \"mutable_uncurry_test.ml\", line 57, characters 7-14", Curry._1(t3({ 3 ]); -eqs("File \"mutable_uncurry_test.ml\", line 59, characters 7-14", ut5({ +eqs("File \"mutable_uncurry_test.ml\", line 49, characters 7-14", ut5({ contents: 1 }, { contents: 2 @@ -244,8 +228,6 @@ exports.test_id = test_id; exports.eqs = eqs; exports.eq = eq; exports.eq2 = eq2; -exports.u = u; -exports.h = h; exports.ut3 = ut3; exports.t3 = t3; exports.ut4 = ut4; diff --git a/jscomp/test/mutable_uncurry_test.ml b/jscomp/test/mutable_uncurry_test.ml index 3cb5057d4e..339cc279d9 100644 --- a/jscomp/test/mutable_uncurry_test.ml +++ b/jscomp/test/mutable_uncurry_test.ml @@ -15,16 +15,6 @@ let eq2 =fun [@bs] x {contents = y} -> x.contents = y ;; eqs __LOC__ false (eq (ref 1) (ref 2) [@bs]) ;; eqs __LOC__ true (eq (ref 2) (ref 2) [@bs]) -let u = object - method hi {contents = x} {contents = y} = - (x : int) = y -end;; - - -let h = u##hi (ref 1) (ref 2) - -;; eqs __LOC__ h false - let ut3 = fun [@bs] {contents = x0} {contents = x1} {contents = x2} -> (x0,x1,x2) diff --git a/jscomp/test/ppx_this_obj_field.js b/jscomp/test/ppx_this_obj_field.js deleted file mode 100644 index 18de6a6910..0000000000 --- a/jscomp/test/ppx_this_obj_field.js +++ /dev/null @@ -1,230 +0,0 @@ -'use strict'; - -var Mt = require("./mt.js"); - -var suites = { - contents: /* [] */0 -}; - -var test_id = { - contents: 0 -}; - -function eq(loc, param) { - var y = param[1]; - var x = param[0]; - test_id.contents = test_id.contents + 1 | 0; - suites.contents = { - hd: [ - loc + (" id " + String(test_id.contents)), - (function (param) { - return { - TAG: /* Eq */0, - _0: x, - _1: y - }; - }) - ], - tl: suites.contents - }; -} - -var v5 = { - x: 3, - y: 3, - setY: (function (v) { - var self = this ; - self.y = 2; - return [ - self.y, - v - ]; - }), - say: (function () { - var self = this ; - return self.x + self.y | 0; - }), - hihi: (function (u) { - var self = this ; - return self.x + self.say() | 0; - }), - bark: (function () { - console.log("bark"); - }), - xz: (function () { - return 3; - }) -}; - -var v = { - x: 3, - y: 0, - reset: (function () { - var self = this ; - self.y = 0; - }), - incr: (function () { - var self = this ; - self.y = self.y + 1 | 0; - }), - getY: (function () { - var self = this ; - return self.y; - }), - say: (function () { - var self = this ; - return self.x + self.y | 0; - }) -}; - -var u = { - incr: (function () { - console.log("hey"); - }), - getY: (function () { - return 3; - }), - say: (function () { - return 7; - }) -}; - -var test_type_1 = { - hd: v, - tl: /* [] */0 -}; - -var test_type = { - hd: u, - tl: test_type_1 -}; - -var z = { - x: { - contents: 3 - }, - setX: (function (x) { - var self = this ; - self.x.contents = x; - }), - getX: (function () { - var self = this ; - return self.x.contents; - }) -}; - -var eventObj = { - events: [], - empty: (function () { - var self = this ; - var a = self.events; - a.splice(0); - }), - push: (function (a) { - var self = this ; - var xs = self.events; - xs.push(a); - }), - needRebuild: (function () { - var self = this ; - return self.events.length !== 0; - }) -}; - -function test__(x) { - eventObj.push(x); -} - -var zz = { - x: 3, - setX: (function (x) { - var self = this ; - self.x = x; - }), - getX: (function () { - var self = this ; - return self.x; - }) -}; - -var test_type2_1 = { - hd: zz, - tl: /* [] */0 -}; - -var test_type2 = { - hd: z, - tl: test_type2_1 -}; - -eq("File \"ppx_this_obj_field.ml\", line 92, characters 5-12", [ - 6, - v5.say() - ]); - -var a = v.say(); - -v.incr(); - -var b = v.say(); - -v.incr(); - -var c = v.say(); - -v.incr(); - -eq("File \"ppx_this_obj_field.ml\", line 99, characters 5-12", [ - [ - 3, - 4, - 5 - ], - [ - a, - b, - c - ] - ]); - -var aa = z.getX(); - -z.setX(32); - -var bb = z.getX(); - -eq("File \"ppx_this_obj_field.ml\", line 103, characters 5-12", [ - [ - 3, - 32 - ], - [ - aa, - bb - ] - ]); - -var f = { - x: 3, - hei: (function () { - var y = this ; - y.x = y.x + 3 | 0; - }) -}; - -Mt.from_pair_suites("Ppx_this_obj_field", suites.contents); - -exports.suites = suites; -exports.test_id = test_id; -exports.eq = eq; -exports.v5 = v5; -exports.v = v; -exports.u = u; -exports.test_type = test_type; -exports.z = z; -exports.eventObj = eventObj; -exports.test__ = test__; -exports.zz = zz; -exports.test_type2 = test_type2; -exports.f = f; -/* v5 Not a pure module */ diff --git a/jscomp/test/ppx_this_obj_field.ml b/jscomp/test/ppx_this_obj_field.ml deleted file mode 100644 index b25037a9a4..0000000000 --- a/jscomp/test/ppx_this_obj_field.ml +++ /dev/null @@ -1,115 +0,0 @@ -let suites : Mt.pair_suites ref = ref [] -let test_id = ref 0 -let eq loc (x, y) = - incr test_id ; - suites := - (loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites - - -let v5 = - object(self) - val x = 3 - val mutable y = 3 - method private setY v = - self##y #= 2 ; - self##y, v - method say () = - self##x + self##y - method private hihi u = - self##x + self##say () - method private bark () = - Js.log "bark" - method xz () = 3 - end - -let v = - object(self) - val x = 3 - val mutable y = 0 - method private reset () = - y <- 0 - method incr () = - y <- self#y + 1 - (* TODO: the error message is confusing - {[ - self##y #= self##y + 1 - ]} - will be parsed as - {[ - (self##y #= self##y) + 1 - ]} - if we change `#=` into `:=` then - it will not work if `self##y` is indeed a reference - we need document this behavior - *) - method getY () = self#y - method say () = self#x + self#y - end - - -let u = - object (self) - method incr () = Js.log "hey" - method getY () = 3 - method say () = 7 - end - -let test_type = [u ; v] - -let z : < getX : (unit -> int [@bs.meth]); setX : (int -> unit [@bs.meth]) > = - object (self) - val x = ref 3 - method setX x = self#x := x - method getX () = ! (self##x) - end - -let eventObj : < - empty : (unit -> unit [@bs.meth]); - needRebuild : (unit -> bool [@bs.meth]); - push : string * string -> unit [@bs.meth] -> - - = - object (self) - val events : (string * string) array = [||] - method empty () = Js.Vector.empty (self##events) - method push a = (Js.Vector.pushBack a (self##events) : unit ) - method needRebuild () = Array.length self##events <> 0 - (* method currentEvents () = self##events *) - end - -let test__ x = eventObj##push x -let zz : < getX : (unit -> int [@bs.meth]); setX : (int -> unit [@bs.meth]) > = - object (self) - val mutable x = 3 - method setX x = x <- x - method getX () = self#x - end - -let test_type2 = [z;zz] - -let () = - eq __LOC__ (6, v5##say ()); - let a = v##say () in - v##incr (); - let b = v##say () in - v##incr (); - let c = v##say () in - v##incr (); - eq __LOC__ ((3,4,5) , (a,b,c)); - let aa = z##getX () in - let () = z##setX 32 in - let bb = z##getX () in - eq __LOC__ ((3, 32), (aa,bb)) - - -let f = object (_ as y) - val mutable x = 3 - method hei () = - x <- y#x + 3 - -end -let () = - Mt.from_pair_suites __MODULE__ !suites - - diff --git a/jscomp/test/ppx_this_obj_test.js b/jscomp/test/ppx_this_obj_test.js deleted file mode 100644 index 4e264c7051..0000000000 --- a/jscomp/test/ppx_this_obj_test.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -var Mt = require("./mt.js"); - -var suites = { - contents: /* [] */0 -}; - -var test_id = { - contents: 0 -}; - -function eq(loc, param) { - var y = param[1]; - var x = param[0]; - test_id.contents = test_id.contents + 1 | 0; - suites.contents = { - hd: [ - loc + (" id " + String(test_id.contents)), - (function (param) { - return { - TAG: /* Eq */0, - _0: x, - _1: y - }; - }) - ], - tl: suites.contents - }; -} - -var v = { - x: (function () { - return 3; - }), - say: (function (x) { - var self = this ; - return x * self.x(); - }), - hi: (function (x, y) { - var self = this ; - return self.say(x) + y; - }) -}; - -var v2 = { - hi: (function (x, y) { - var self = this ; - return self.say(x) + y; - }), - say: (function (x) { - var self = this ; - return x * self.x(); - }), - x: (function () { - return 3; - }) -}; - -var v3 = { - hi: (function (x, y) { - var self = this ; - var u = { - x: x - }; - return self.say(u.x) + y + x; - }), - say: (function (x) { - var self = this ; - return x * self.x(); - }), - x: (function () { - return 3; - }) -}; - -var v4 = { - hi: (function (x, y) { - return x + y; - }), - say: (function (x) { - return x; - }), - x: (function () { - return 1; - }) -}; - -var collection = [ - v, - v2, - v3, - v4 -]; - -eq("File \"ppx_this_obj_test.ml\", line 59, characters 5-12", [ - 11, - v.hi(3, 2) - ]); - -eq("File \"ppx_this_obj_test.ml\", line 60, characters 5-12", [ - 11, - v2.hi(3, 2) - ]); - -Mt.from_pair_suites("Ppx_this_obj_test", suites.contents); - -exports.suites = suites; -exports.test_id = test_id; -exports.eq = eq; -exports.v = v; -exports.v2 = v2; -exports.v3 = v3; -exports.v4 = v4; -exports.collection = collection; -/* v Not a pure module */ diff --git a/jscomp/test/ppx_this_obj_test.ml b/jscomp/test/ppx_this_obj_test.ml deleted file mode 100644 index ecb358e13e..0000000000 --- a/jscomp/test/ppx_this_obj_test.ml +++ /dev/null @@ -1,62 +0,0 @@ -let suites : Mt.pair_suites ref = ref [] -let test_id = ref 0 -let eq loc (x, y) = - incr test_id ; - suites := - (loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites - -let v = - let x = 3. in - object (self) - method x () = x - method say x = x *. self## x () - method hi x y = self##say x +. y - end -(** compile infer -class type js_obj = object - method x : unit -> float - method say : float -> float - method hi : float -> float -> float -end [@bs] -val js_obj : js_obj -*) - -let v2 = - let x = 3. in - object (self) - method hi x = fun y -> self##say x +. y - method say = fun x -> x *. self## x () - method x () = x - end - - -let v3 = - let x = 3. in - object (self) - method hi x y = - let u = [%bs.obj{ x }] in - self##say u##x +. y +.x - method say = fun x -> x *. self## x () - method x () = x - end - -let v4 = - object - method hi x y = x +. y - method say x = x - method x () = 1. - end - -(* let v5 = *) -(* object *) -(* method x = x *) -(* end [@bs] *) - -(** guarantee they have the same type *) -let collection = [| v ; v2 ; v3 ; v4 |] - -let () = - eq __LOC__ (11., v##hi 3. 2.); - eq __LOC__ (11., v2##hi 3. 2.) - -let () = Mt.from_pair_suites __MODULE__ !suites diff --git a/jscomp/test/uncurry_method.js b/jscomp/test/uncurry_method.js deleted file mode 100644 index f9dcfef33b..0000000000 --- a/jscomp/test/uncurry_method.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - - -var obj = { - hi: (function (a, b) { - return a + b | 0; - }), - say: (function (a, b) { - return a - b | 0; - }), - xx: (function (a, b) { - return a - b | 0; - }) -}; - -function f(x, a, b) { - return x.hi(a, b); -} - -var h = obj.hi; - -console.log(f(obj, 3, 4)); - -function x(h) { - return h.raw(0, 0); -} - -function f1(u) { - u.exit(2); -} - -var obj3 = { - hi: (function (name, age) { - console.log(name); - }), - hh: (function () { - var self = this ; - self.hi("x", 20); - }) -}; - -var obj2 = { - hi: (function (a, b) { - return a + b | 0; - }), - say: (function (a, b) { - var self = this ; - return self.hi(a, b) - 1 | 0; - }), - xx: (function (a, b) { - return a - b | 0; - }) -}; - -exports.obj = obj; -exports.f = f; -exports.h = h; -exports.x = x; -exports.f1 = f1; -exports.obj3 = obj3; -exports.obj2 = obj2; -/* obj Not a pure module */ diff --git a/jscomp/test/uncurry_method.ml b/jscomp/test/uncurry_method.ml deleted file mode 100644 index 05d3b460c7..0000000000 --- a/jscomp/test/uncurry_method.ml +++ /dev/null @@ -1,62 +0,0 @@ - -let obj = object - method hi a b = a + b - method say a b = a - b - method xx a b = a - b -end - -let f x (a:int) (b:int) = x##hi a b - -let h = obj##hi - - -;; f obj 3 4 |. Js.log - - - -let x h = h##raw ~x:0 ~y:0 - -class type pro = object - method exit : code:int -> unit -end - -let f1 (u : pro ) = u##exit ~code:2 - -(* let obj3 = - let module J = - struct - external unsafe_expr : - hi:((< hi: (name:'hi0 -> age:'hi1 -> 'hi) Js_OO.Meth.arity2 > - as 'self_type) - -> name:'hi0 -> age:'hi1 -> 'hi) - Js_OO.Callback.arity3 -> - < hi: (name:'hi0 -> age:'hi1 -> 'hi) Js_OO.Meth.arity2 > = - "" - "\132\149\166\190\000\000\000\t\000\000\000\005\000\000\000\012\000\000\000\012\145\160\160A\144\"hi@" - end in - J.unsafe_expr - ~hi:( - (fun [@bs.this] _ -> fun ~name -> fun ~age -> Js.log name) - ) *) -let obj3 = object (self) - method hi ~(name : string) ~(age : int) = name |. Js.log - method hh () = self##hi ~name:"x" ~age:20 -end -(* TODO: not supported yet - *) - (* Type < hi : name:string -> age:int -> 'b; .. > as 'a - is not compatible with type - < hh : (unit -> 'c [@bs.meth]); - hi : (name:string -> age:int -> unit [@bs.meth]) > - *) -type add_meth = int -> int -> int [@meth] - -let obj2 : < - hi : add_meth; - say : add_meth; - xx : add_meth -> = object (self : 'a) - method hi a b = a + b - method say a b = self##hi a b - 1 - method xx a b = a - b -end \ No newline at end of file diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml index 61cdaacc7f..a4cfbafc54 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -149958,166 +149958,6 @@ let pval_prim_of_option_labels (labels : (bool * string Asttypes.loc) list) in External_ffi_types.ffi_obj_as_prims arg_kinds -end -module Ast_uncurry_gen : sig -#1 "ast_uncurry_gen.mli" -(* Copyright (C) 2020- Authors of ReScript - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) - -val to_uncurry_fn : - Location.t -> - Bs_ast_mapper.mapper -> - Asttypes.arg_label -> - Parsetree.pattern -> - Parsetree.expression -> - bool -> (* async *) - Parsetree.expression_desc -(** - [function] can only take one argument, that is the reason we did not adopt it - syntax: - {[ fun [@bs] pat pat1-> body ]} - [to_uncurry_fn (fun pat -> (fun pat1 -> ... body))] - -*) - -val to_method_callback : - Location.t -> - Bs_ast_mapper.mapper -> - Asttypes.arg_label -> - Parsetree.pattern -> - Parsetree.expression -> - Parsetree.expression_desc -(** syntax: - {[fun [@bs.this] obj pat pat1 -> body]} -*) - -end = struct -#1 "ast_uncurry_gen.ml" -(* Copyright (C) 2020- Hongbo Zhang, Authors of ReScript - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) - -open Ast_helper - -(* Handling `fun [@this]` used in `object [@bs] end` *) -let to_method_callback loc (self : Bs_ast_mapper.mapper) label - (self_pat : Parsetree.pattern) body : Parsetree.expression_desc = - let self_pat = self.pat self self_pat in - (match Ast_pat.is_single_variable_pattern_conservative self_pat with - | None -> Bs_syntaxerr.err self_pat.ppat_loc Bs_this_simple_pattern - | Some self -> Stack.push self Js_config.self_stack); - Bs_syntaxerr.optional_err loc label; - let rec aux acc (body : Parsetree.expression) = - match Ast_attributes.process_attributes_rev body.pexp_attributes with - | Nothing, _ -> ( - match body.pexp_desc with - | Pexp_fun (arg_label, _, arg, body) -> - Bs_syntaxerr.optional_err loc arg_label; - aux ((arg_label, self.pat self arg) :: acc) body - | _ -> (self.expr self body, acc)) - | _, _ -> (self.expr self body, acc) - in - let result, rev_extra_args = aux [ (label, self_pat) ] body in - let body = - Ext_list.fold_left rev_extra_args result (fun e (label, p) -> - Ast_helper.Exp.fun_ ~loc label None p e) - in - let arity = List.length rev_extra_args in - let arity_s = string_of_int arity in - Stack.pop Js_config.self_stack |> ignore; - Parsetree.Pexp_apply - ( Exp.ident ~loc - { loc; txt = Ldot (Ast_literal.Lid.js_oo, "unsafe_to_method") }, - [ - ( Nolabel, - Exp.constraint_ ~loc - (Exp.record ~loc - [ ({ loc; txt = Ast_literal.Lid.hidden_field arity_s }, body) ] - None) - (Typ.constr ~loc - { - loc; - txt = Ldot (Ast_literal.Lid.js_meth_callback, "arity" ^ arity_s); - } - [ Typ.any ~loc () ]) ); - ] ) - -let to_uncurry_fn loc (self : Bs_ast_mapper.mapper) (label : Asttypes.arg_label) - pat body async : Parsetree.expression_desc = - Bs_syntaxerr.optional_err loc label; - let rec aux acc (body : Parsetree.expression) = - match Ast_attributes.process_attributes_rev body.pexp_attributes with - | Nothing, _ -> ( - match body.pexp_desc with - | Pexp_fun (arg_label, _, arg, body) -> - Bs_syntaxerr.optional_err loc arg_label; - aux ((arg_label, self.pat self arg) :: acc) body - | _ -> (self.expr self body, acc)) - | _, _ -> (self.expr self body, acc) - in - let first_arg = self.pat self pat in - - let result, rev_extra_args = aux [ (label, first_arg) ] body in - let result = Ast_async.add_promise_type ~async result in - let body = - Ext_list.fold_left rev_extra_args result (fun e (label, p) -> - Ast_helper.Exp.fun_ ~loc label None p e) - in - let body = Ast_async.add_async_attribute ~async body in - - let len = List.length rev_extra_args in - let arity = - match rev_extra_args with - | [ (_, p) ] -> Ast_pat.is_unit_cont ~yes:0 ~no:len p - | _ -> len - in - Bs_syntaxerr.err_large_arity loc arity; - let arity_s = string_of_int arity in - Pexp_record - ( [ ({ txt = Ldot (Ast_literal.Lid.js_fn, "I" ^ arity_s); loc }, body) ], - None ) - end module Ast_util : sig #1 "ast_util.mli" @@ -150159,13 +149999,6 @@ val record_as_js_object : val js_property : Location.t -> Parsetree.expression -> string -> Parsetree.expression_desc -val ocaml_obj_as_js_object : - Location.t -> - Bs_ast_mapper.mapper -> - Parsetree.pattern -> - Parsetree.class_field list -> - Parsetree.expression_desc - end = struct #1 "ast_util.ml" (* Copyright (C) 2015-2016 Bloomberg Finance L.P. @@ -150192,172 +150025,11 @@ end = struct * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -open Ast_helper - type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list let js_property loc obj (name : string) = Parsetree.Pexp_send (obj, { loc; txt = name }) -let ocaml_obj_as_js_object loc (mapper : Bs_ast_mapper.mapper) - (self_pat : Parsetree.pattern) (clfs : Parsetree.class_field list) = - (* Attention: we should avoid type variable conflict for each method - Since the method name is unique, there would be no conflict - OCaml does not allow duplicate instance variable and duplicate methods, - but it does allow duplicates between instance variable and method name, - we should enforce such rules - {[ - object [@bs] - val x = 3 - method x = 3 - end - ]} should not compile with a meaningful error message - *) - let generate_val_method_pair loc (mapper : Bs_ast_mapper.mapper) - (val_name : string Asttypes.loc) is_mutable = - let result = Typ.var ~loc val_name.txt in - ( result, - Parsetree.Otag (val_name, [], result) - :: - (if is_mutable then - [ - Otag - ( { val_name with txt = val_name.txt ^ Literals.setter_suffix }, - [], - Ast_typ_uncurry.to_method_type loc mapper Nolabel result - (Ast_literal.type_unit ~loc ()) ); - ] - else []) ) - in - - (* Note mapper is only for API compatible - * TODO: we should check label name to avoid conflict - *) - - (* we need calculate the real object type - and exposed object type, in some cases there are equivalent - - for public object type its [@meth] it does not depend on itself - while for label argument it is [@this] which depends internal object - *) - let ( (internal_label_attr_types : Parsetree.object_field list), - (public_label_attr_types : Parsetree.object_field list) ) = - Ext_list.fold_right clfs ([], []) - (fun - ({ pcf_loc = loc } as x : Parsetree.class_field) - (label_attr_types, public_label_attr_types) - -> - match x.pcf_desc with - | Pcf_method (label, public_flag, Cfk_concrete (Fresh, e)) -> ( - match e.pexp_desc with - | Pexp_poly ({ pexp_desc = Pexp_fun (lbl, _, pat, e) }, None) -> - let method_type = - Ast_typ_uncurry.generate_arg_type x.pcf_loc mapper label.txt - lbl pat e - in - ( Parsetree.Otag (label, [], method_type) :: label_attr_types, - if public_flag = Public then - Parsetree.Otag (label, [], method_type) - :: public_label_attr_types - else public_label_attr_types ) - | Pexp_poly (_, Some _) -> - Location.raise_errorf ~loc - "polymorphic type annotation not supported yet" - | Pexp_poly (_, None) -> - Location.raise_errorf ~loc - "Unsupported syntax, expect syntax like `method x () = x ` " - | _ -> Location.raise_errorf ~loc "Unsupported syntax in js object") - | Pcf_val (label, mutable_flag, Cfk_concrete (Fresh, _)) -> - let _, label_attr = - generate_val_method_pair x.pcf_loc mapper label - (mutable_flag = Mutable) - in - ( Ext_list.append label_attr label_attr_types, - public_label_attr_types ) - | Pcf_val (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not support currently" - | Pcf_val (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtual flag not support currently" - | Pcf_method (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not supported" - | Pcf_method (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtural method not supported" - | Pcf_inherit _ | Pcf_initializer _ | Pcf_attribute _ | Pcf_extension _ - | Pcf_constraint _ -> - Location.raise_errorf ~loc "Only method support currently") - in - let internal_obj_type = - Ast_core_type.make_obj ~loc internal_label_attr_types - in - let public_obj_type = Ast_core_type.make_obj ~loc public_label_attr_types in - let labels, label_types, exprs, _ = - Ext_list.fold_right clfs ([], [], [], false) - (fun (x : Parsetree.class_field) (labels, label_types, exprs, aliased) -> - match x.pcf_desc with - | Pcf_method (label, _public_flag, Cfk_concrete (Fresh, e)) -> ( - match e.pexp_desc with - | Pexp_poly - (({ pexp_desc = Pexp_fun (ll, None, pat, e) } as f), None) -> - let alias_type = - if aliased then None else Some internal_obj_type - in - let label_type = - Ast_typ_uncurry.generate_method_type ?alias_type x.pcf_loc - mapper label.txt ll pat e - in - ( label :: labels, - label_type :: label_types, - { - f with - pexp_desc = - (let f = Ast_pat.is_unit_cont pat ~yes:e ~no:f in - Ast_uncurry_gen.to_method_callback loc mapper Nolabel - self_pat f) - (* the first argument is this*); - } - :: exprs, - true ) - | Pexp_poly (_, Some _) -> - Location.raise_errorf ~loc - "polymorphic type annotation not supported yet" - | Pexp_poly (_, None) -> - Location.raise_errorf ~loc - "Unsupported syntax, expect syntax like `method x () = x ` " - | _ -> Location.raise_errorf ~loc "Unsupported syntax in js object") - | Pcf_val (label, mutable_flag, Cfk_concrete (Fresh, val_exp)) -> - let label_type, _ = - generate_val_method_pair x.pcf_loc mapper label - (mutable_flag = Mutable) - in - ( label :: labels, - label_type :: label_types, - mapper.expr mapper val_exp :: exprs, - aliased ) - | Pcf_val (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not support currently" - | Pcf_val (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtual flag not support currently" - | Pcf_method (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not supported" - | Pcf_method (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtural method not supported" - | Pcf_inherit _ | Pcf_initializer _ | Pcf_attribute _ | Pcf_extension _ - | Pcf_constraint _ -> - Location.raise_errorf ~loc "Only method support currently") - in - let pval_type = - Ext_list.fold_right2 labels label_types public_obj_type - (fun label label_type acc -> - Ast_compatible.label_arrow ~loc:label.Asttypes.loc label.Asttypes.txt - label_type acc) - in - Ast_external_mk.local_extern_cont_to_obj loc - ~pval_prim:(Ast_external_process.pval_prim_of_labels labels) - (fun e -> - Ast_compatible.apply_labels ~loc e - (Ext_list.map2 labels exprs (fun l expr -> (l.txt, expr)))) - ~pval_type - let record_as_js_object loc (self : Bs_ast_mapper.mapper) (label_exprs : label_exprs) : Parsetree.expression_desc = let labels, args, arity = @@ -151915,6 +151587,166 @@ let value_bindings_mapper (self : Bs_ast_mapper.mapper) Ext_list.fold_right vbs [] (fun vb acc -> flattern_tuple_pattern_vb self vb acc) +end +module Ast_uncurry_gen : sig +#1 "ast_uncurry_gen.mli" +(* Copyright (C) 2020- Authors of ReScript + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + +val to_uncurry_fn : + Location.t -> + Bs_ast_mapper.mapper -> + Asttypes.arg_label -> + Parsetree.pattern -> + Parsetree.expression -> + bool -> (* async *) + Parsetree.expression_desc +(** + [function] can only take one argument, that is the reason we did not adopt it + syntax: + {[ fun [@bs] pat pat1-> body ]} + [to_uncurry_fn (fun pat -> (fun pat1 -> ... body))] + +*) + +val to_method_callback : + Location.t -> + Bs_ast_mapper.mapper -> + Asttypes.arg_label -> + Parsetree.pattern -> + Parsetree.expression -> + Parsetree.expression_desc +(** syntax: + {[fun [@bs.this] obj pat pat1 -> body]} +*) + +end = struct +#1 "ast_uncurry_gen.ml" +(* Copyright (C) 2020- Hongbo Zhang, Authors of ReScript + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + +open Ast_helper + +(* Handling `fun [@this]` used in `object [@bs] end` *) +let to_method_callback loc (self : Bs_ast_mapper.mapper) label + (self_pat : Parsetree.pattern) body : Parsetree.expression_desc = + let self_pat = self.pat self self_pat in + (match Ast_pat.is_single_variable_pattern_conservative self_pat with + | None -> Bs_syntaxerr.err self_pat.ppat_loc Bs_this_simple_pattern + | Some self -> Stack.push self Js_config.self_stack); + Bs_syntaxerr.optional_err loc label; + let rec aux acc (body : Parsetree.expression) = + match Ast_attributes.process_attributes_rev body.pexp_attributes with + | Nothing, _ -> ( + match body.pexp_desc with + | Pexp_fun (arg_label, _, arg, body) -> + Bs_syntaxerr.optional_err loc arg_label; + aux ((arg_label, self.pat self arg) :: acc) body + | _ -> (self.expr self body, acc)) + | _, _ -> (self.expr self body, acc) + in + let result, rev_extra_args = aux [ (label, self_pat) ] body in + let body = + Ext_list.fold_left rev_extra_args result (fun e (label, p) -> + Ast_helper.Exp.fun_ ~loc label None p e) + in + let arity = List.length rev_extra_args in + let arity_s = string_of_int arity in + Stack.pop Js_config.self_stack |> ignore; + Parsetree.Pexp_apply + ( Exp.ident ~loc + { loc; txt = Ldot (Ast_literal.Lid.js_oo, "unsafe_to_method") }, + [ + ( Nolabel, + Exp.constraint_ ~loc + (Exp.record ~loc + [ ({ loc; txt = Ast_literal.Lid.hidden_field arity_s }, body) ] + None) + (Typ.constr ~loc + { + loc; + txt = Ldot (Ast_literal.Lid.js_meth_callback, "arity" ^ arity_s); + } + [ Typ.any ~loc () ]) ); + ] ) + +let to_uncurry_fn loc (self : Bs_ast_mapper.mapper) (label : Asttypes.arg_label) + pat body async : Parsetree.expression_desc = + Bs_syntaxerr.optional_err loc label; + let rec aux acc (body : Parsetree.expression) = + match Ast_attributes.process_attributes_rev body.pexp_attributes with + | Nothing, _ -> ( + match body.pexp_desc with + | Pexp_fun (arg_label, _, arg, body) -> + Bs_syntaxerr.optional_err loc arg_label; + aux ((arg_label, self.pat self arg) :: acc) body + | _ -> (self.expr self body, acc)) + | _, _ -> (self.expr self body, acc) + in + let first_arg = self.pat self pat in + + let result, rev_extra_args = aux [ (label, first_arg) ] body in + let result = Ast_async.add_promise_type ~async result in + let body = + Ext_list.fold_left rev_extra_args result (fun e (label, p) -> + Ast_helper.Exp.fun_ ~loc label None p e) + in + let body = Ast_async.add_async_attribute ~async body in + + let len = List.length rev_extra_args in + let arity = + match rev_extra_args with + | [ (_, p) ] -> Ast_pat.is_unit_cont ~yes:0 ~no:len p + | _ -> len + in + Bs_syntaxerr.err_large_arity loc arity; + let arity_s = string_of_int arity in + Pexp_record + ( [ ({ txt = Ldot (Ast_literal.Lid.js_fn, "I" ^ arity_s); loc }, body) ], + None ) + end module Typemod_hide = struct @@ -152201,22 +152033,6 @@ let expr_mapper ~async_context ~in_function_def (self : mapper) pexp_attributes; }) | Pexp_apply (fn, args) -> Ast_exp_apply.app_exp_mapper e self fn args - | Pexp_object { pcstr_self; pcstr_fields } -> - let pexp_attributes = - match Ast_attributes.process_bs e.pexp_attributes with - | true, pexp_attributes -> - Location.prerr_warning e.pexp_loc - (Bs_ffi_warning "Here @bs attribute not needed any more"); - pexp_attributes - | false, e -> e - in - { - e with - pexp_desc = - Ast_util.ocaml_obj_as_js_object e.pexp_loc self pcstr_self - pcstr_fields; - pexp_attributes; - } | Pexp_match ( b, [ diff --git a/lib/4.06.1/unstable/js_playground_compiler.ml b/lib/4.06.1/unstable/js_playground_compiler.ml index 6f78726582..82b9ba2624 100644 --- a/lib/4.06.1/unstable/js_playground_compiler.ml +++ b/lib/4.06.1/unstable/js_playground_compiler.ml @@ -149958,166 +149958,6 @@ let pval_prim_of_option_labels (labels : (bool * string Asttypes.loc) list) in External_ffi_types.ffi_obj_as_prims arg_kinds -end -module Ast_uncurry_gen : sig -#1 "ast_uncurry_gen.mli" -(* Copyright (C) 2020- Authors of ReScript - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) - -val to_uncurry_fn : - Location.t -> - Bs_ast_mapper.mapper -> - Asttypes.arg_label -> - Parsetree.pattern -> - Parsetree.expression -> - bool -> (* async *) - Parsetree.expression_desc -(** - [function] can only take one argument, that is the reason we did not adopt it - syntax: - {[ fun [@bs] pat pat1-> body ]} - [to_uncurry_fn (fun pat -> (fun pat1 -> ... body))] - -*) - -val to_method_callback : - Location.t -> - Bs_ast_mapper.mapper -> - Asttypes.arg_label -> - Parsetree.pattern -> - Parsetree.expression -> - Parsetree.expression_desc -(** syntax: - {[fun [@bs.this] obj pat pat1 -> body]} -*) - -end = struct -#1 "ast_uncurry_gen.ml" -(* Copyright (C) 2020- Hongbo Zhang, Authors of ReScript - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) - -open Ast_helper - -(* Handling `fun [@this]` used in `object [@bs] end` *) -let to_method_callback loc (self : Bs_ast_mapper.mapper) label - (self_pat : Parsetree.pattern) body : Parsetree.expression_desc = - let self_pat = self.pat self self_pat in - (match Ast_pat.is_single_variable_pattern_conservative self_pat with - | None -> Bs_syntaxerr.err self_pat.ppat_loc Bs_this_simple_pattern - | Some self -> Stack.push self Js_config.self_stack); - Bs_syntaxerr.optional_err loc label; - let rec aux acc (body : Parsetree.expression) = - match Ast_attributes.process_attributes_rev body.pexp_attributes with - | Nothing, _ -> ( - match body.pexp_desc with - | Pexp_fun (arg_label, _, arg, body) -> - Bs_syntaxerr.optional_err loc arg_label; - aux ((arg_label, self.pat self arg) :: acc) body - | _ -> (self.expr self body, acc)) - | _, _ -> (self.expr self body, acc) - in - let result, rev_extra_args = aux [ (label, self_pat) ] body in - let body = - Ext_list.fold_left rev_extra_args result (fun e (label, p) -> - Ast_helper.Exp.fun_ ~loc label None p e) - in - let arity = List.length rev_extra_args in - let arity_s = string_of_int arity in - Stack.pop Js_config.self_stack |> ignore; - Parsetree.Pexp_apply - ( Exp.ident ~loc - { loc; txt = Ldot (Ast_literal.Lid.js_oo, "unsafe_to_method") }, - [ - ( Nolabel, - Exp.constraint_ ~loc - (Exp.record ~loc - [ ({ loc; txt = Ast_literal.Lid.hidden_field arity_s }, body) ] - None) - (Typ.constr ~loc - { - loc; - txt = Ldot (Ast_literal.Lid.js_meth_callback, "arity" ^ arity_s); - } - [ Typ.any ~loc () ]) ); - ] ) - -let to_uncurry_fn loc (self : Bs_ast_mapper.mapper) (label : Asttypes.arg_label) - pat body async : Parsetree.expression_desc = - Bs_syntaxerr.optional_err loc label; - let rec aux acc (body : Parsetree.expression) = - match Ast_attributes.process_attributes_rev body.pexp_attributes with - | Nothing, _ -> ( - match body.pexp_desc with - | Pexp_fun (arg_label, _, arg, body) -> - Bs_syntaxerr.optional_err loc arg_label; - aux ((arg_label, self.pat self arg) :: acc) body - | _ -> (self.expr self body, acc)) - | _, _ -> (self.expr self body, acc) - in - let first_arg = self.pat self pat in - - let result, rev_extra_args = aux [ (label, first_arg) ] body in - let result = Ast_async.add_promise_type ~async result in - let body = - Ext_list.fold_left rev_extra_args result (fun e (label, p) -> - Ast_helper.Exp.fun_ ~loc label None p e) - in - let body = Ast_async.add_async_attribute ~async body in - - let len = List.length rev_extra_args in - let arity = - match rev_extra_args with - | [ (_, p) ] -> Ast_pat.is_unit_cont ~yes:0 ~no:len p - | _ -> len - in - Bs_syntaxerr.err_large_arity loc arity; - let arity_s = string_of_int arity in - Pexp_record - ( [ ({ txt = Ldot (Ast_literal.Lid.js_fn, "I" ^ arity_s); loc }, body) ], - None ) - end module Ast_util : sig #1 "ast_util.mli" @@ -150159,13 +149999,6 @@ val record_as_js_object : val js_property : Location.t -> Parsetree.expression -> string -> Parsetree.expression_desc -val ocaml_obj_as_js_object : - Location.t -> - Bs_ast_mapper.mapper -> - Parsetree.pattern -> - Parsetree.class_field list -> - Parsetree.expression_desc - end = struct #1 "ast_util.ml" (* Copyright (C) 2015-2016 Bloomberg Finance L.P. @@ -150192,172 +150025,11 @@ end = struct * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -open Ast_helper - type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list let js_property loc obj (name : string) = Parsetree.Pexp_send (obj, { loc; txt = name }) -let ocaml_obj_as_js_object loc (mapper : Bs_ast_mapper.mapper) - (self_pat : Parsetree.pattern) (clfs : Parsetree.class_field list) = - (* Attention: we should avoid type variable conflict for each method - Since the method name is unique, there would be no conflict - OCaml does not allow duplicate instance variable and duplicate methods, - but it does allow duplicates between instance variable and method name, - we should enforce such rules - {[ - object [@bs] - val x = 3 - method x = 3 - end - ]} should not compile with a meaningful error message - *) - let generate_val_method_pair loc (mapper : Bs_ast_mapper.mapper) - (val_name : string Asttypes.loc) is_mutable = - let result = Typ.var ~loc val_name.txt in - ( result, - Parsetree.Otag (val_name, [], result) - :: - (if is_mutable then - [ - Otag - ( { val_name with txt = val_name.txt ^ Literals.setter_suffix }, - [], - Ast_typ_uncurry.to_method_type loc mapper Nolabel result - (Ast_literal.type_unit ~loc ()) ); - ] - else []) ) - in - - (* Note mapper is only for API compatible - * TODO: we should check label name to avoid conflict - *) - - (* we need calculate the real object type - and exposed object type, in some cases there are equivalent - - for public object type its [@meth] it does not depend on itself - while for label argument it is [@this] which depends internal object - *) - let ( (internal_label_attr_types : Parsetree.object_field list), - (public_label_attr_types : Parsetree.object_field list) ) = - Ext_list.fold_right clfs ([], []) - (fun - ({ pcf_loc = loc } as x : Parsetree.class_field) - (label_attr_types, public_label_attr_types) - -> - match x.pcf_desc with - | Pcf_method (label, public_flag, Cfk_concrete (Fresh, e)) -> ( - match e.pexp_desc with - | Pexp_poly ({ pexp_desc = Pexp_fun (lbl, _, pat, e) }, None) -> - let method_type = - Ast_typ_uncurry.generate_arg_type x.pcf_loc mapper label.txt - lbl pat e - in - ( Parsetree.Otag (label, [], method_type) :: label_attr_types, - if public_flag = Public then - Parsetree.Otag (label, [], method_type) - :: public_label_attr_types - else public_label_attr_types ) - | Pexp_poly (_, Some _) -> - Location.raise_errorf ~loc - "polymorphic type annotation not supported yet" - | Pexp_poly (_, None) -> - Location.raise_errorf ~loc - "Unsupported syntax, expect syntax like `method x () = x ` " - | _ -> Location.raise_errorf ~loc "Unsupported syntax in js object") - | Pcf_val (label, mutable_flag, Cfk_concrete (Fresh, _)) -> - let _, label_attr = - generate_val_method_pair x.pcf_loc mapper label - (mutable_flag = Mutable) - in - ( Ext_list.append label_attr label_attr_types, - public_label_attr_types ) - | Pcf_val (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not support currently" - | Pcf_val (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtual flag not support currently" - | Pcf_method (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not supported" - | Pcf_method (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtural method not supported" - | Pcf_inherit _ | Pcf_initializer _ | Pcf_attribute _ | Pcf_extension _ - | Pcf_constraint _ -> - Location.raise_errorf ~loc "Only method support currently") - in - let internal_obj_type = - Ast_core_type.make_obj ~loc internal_label_attr_types - in - let public_obj_type = Ast_core_type.make_obj ~loc public_label_attr_types in - let labels, label_types, exprs, _ = - Ext_list.fold_right clfs ([], [], [], false) - (fun (x : Parsetree.class_field) (labels, label_types, exprs, aliased) -> - match x.pcf_desc with - | Pcf_method (label, _public_flag, Cfk_concrete (Fresh, e)) -> ( - match e.pexp_desc with - | Pexp_poly - (({ pexp_desc = Pexp_fun (ll, None, pat, e) } as f), None) -> - let alias_type = - if aliased then None else Some internal_obj_type - in - let label_type = - Ast_typ_uncurry.generate_method_type ?alias_type x.pcf_loc - mapper label.txt ll pat e - in - ( label :: labels, - label_type :: label_types, - { - f with - pexp_desc = - (let f = Ast_pat.is_unit_cont pat ~yes:e ~no:f in - Ast_uncurry_gen.to_method_callback loc mapper Nolabel - self_pat f) - (* the first argument is this*); - } - :: exprs, - true ) - | Pexp_poly (_, Some _) -> - Location.raise_errorf ~loc - "polymorphic type annotation not supported yet" - | Pexp_poly (_, None) -> - Location.raise_errorf ~loc - "Unsupported syntax, expect syntax like `method x () = x ` " - | _ -> Location.raise_errorf ~loc "Unsupported syntax in js object") - | Pcf_val (label, mutable_flag, Cfk_concrete (Fresh, val_exp)) -> - let label_type, _ = - generate_val_method_pair x.pcf_loc mapper label - (mutable_flag = Mutable) - in - ( label :: labels, - label_type :: label_types, - mapper.expr mapper val_exp :: exprs, - aliased ) - | Pcf_val (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not support currently" - | Pcf_val (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtual flag not support currently" - | Pcf_method (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not supported" - | Pcf_method (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtural method not supported" - | Pcf_inherit _ | Pcf_initializer _ | Pcf_attribute _ | Pcf_extension _ - | Pcf_constraint _ -> - Location.raise_errorf ~loc "Only method support currently") - in - let pval_type = - Ext_list.fold_right2 labels label_types public_obj_type - (fun label label_type acc -> - Ast_compatible.label_arrow ~loc:label.Asttypes.loc label.Asttypes.txt - label_type acc) - in - Ast_external_mk.local_extern_cont_to_obj loc - ~pval_prim:(Ast_external_process.pval_prim_of_labels labels) - (fun e -> - Ast_compatible.apply_labels ~loc e - (Ext_list.map2 labels exprs (fun l expr -> (l.txt, expr)))) - ~pval_type - let record_as_js_object loc (self : Bs_ast_mapper.mapper) (label_exprs : label_exprs) : Parsetree.expression_desc = let labels, args, arity = @@ -151915,6 +151587,166 @@ let value_bindings_mapper (self : Bs_ast_mapper.mapper) Ext_list.fold_right vbs [] (fun vb acc -> flattern_tuple_pattern_vb self vb acc) +end +module Ast_uncurry_gen : sig +#1 "ast_uncurry_gen.mli" +(* Copyright (C) 2020- Authors of ReScript + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + +val to_uncurry_fn : + Location.t -> + Bs_ast_mapper.mapper -> + Asttypes.arg_label -> + Parsetree.pattern -> + Parsetree.expression -> + bool -> (* async *) + Parsetree.expression_desc +(** + [function] can only take one argument, that is the reason we did not adopt it + syntax: + {[ fun [@bs] pat pat1-> body ]} + [to_uncurry_fn (fun pat -> (fun pat1 -> ... body))] + +*) + +val to_method_callback : + Location.t -> + Bs_ast_mapper.mapper -> + Asttypes.arg_label -> + Parsetree.pattern -> + Parsetree.expression -> + Parsetree.expression_desc +(** syntax: + {[fun [@bs.this] obj pat pat1 -> body]} +*) + +end = struct +#1 "ast_uncurry_gen.ml" +(* Copyright (C) 2020- Hongbo Zhang, Authors of ReScript + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + +open Ast_helper + +(* Handling `fun [@this]` used in `object [@bs] end` *) +let to_method_callback loc (self : Bs_ast_mapper.mapper) label + (self_pat : Parsetree.pattern) body : Parsetree.expression_desc = + let self_pat = self.pat self self_pat in + (match Ast_pat.is_single_variable_pattern_conservative self_pat with + | None -> Bs_syntaxerr.err self_pat.ppat_loc Bs_this_simple_pattern + | Some self -> Stack.push self Js_config.self_stack); + Bs_syntaxerr.optional_err loc label; + let rec aux acc (body : Parsetree.expression) = + match Ast_attributes.process_attributes_rev body.pexp_attributes with + | Nothing, _ -> ( + match body.pexp_desc with + | Pexp_fun (arg_label, _, arg, body) -> + Bs_syntaxerr.optional_err loc arg_label; + aux ((arg_label, self.pat self arg) :: acc) body + | _ -> (self.expr self body, acc)) + | _, _ -> (self.expr self body, acc) + in + let result, rev_extra_args = aux [ (label, self_pat) ] body in + let body = + Ext_list.fold_left rev_extra_args result (fun e (label, p) -> + Ast_helper.Exp.fun_ ~loc label None p e) + in + let arity = List.length rev_extra_args in + let arity_s = string_of_int arity in + Stack.pop Js_config.self_stack |> ignore; + Parsetree.Pexp_apply + ( Exp.ident ~loc + { loc; txt = Ldot (Ast_literal.Lid.js_oo, "unsafe_to_method") }, + [ + ( Nolabel, + Exp.constraint_ ~loc + (Exp.record ~loc + [ ({ loc; txt = Ast_literal.Lid.hidden_field arity_s }, body) ] + None) + (Typ.constr ~loc + { + loc; + txt = Ldot (Ast_literal.Lid.js_meth_callback, "arity" ^ arity_s); + } + [ Typ.any ~loc () ]) ); + ] ) + +let to_uncurry_fn loc (self : Bs_ast_mapper.mapper) (label : Asttypes.arg_label) + pat body async : Parsetree.expression_desc = + Bs_syntaxerr.optional_err loc label; + let rec aux acc (body : Parsetree.expression) = + match Ast_attributes.process_attributes_rev body.pexp_attributes with + | Nothing, _ -> ( + match body.pexp_desc with + | Pexp_fun (arg_label, _, arg, body) -> + Bs_syntaxerr.optional_err loc arg_label; + aux ((arg_label, self.pat self arg) :: acc) body + | _ -> (self.expr self body, acc)) + | _, _ -> (self.expr self body, acc) + in + let first_arg = self.pat self pat in + + let result, rev_extra_args = aux [ (label, first_arg) ] body in + let result = Ast_async.add_promise_type ~async result in + let body = + Ext_list.fold_left rev_extra_args result (fun e (label, p) -> + Ast_helper.Exp.fun_ ~loc label None p e) + in + let body = Ast_async.add_async_attribute ~async body in + + let len = List.length rev_extra_args in + let arity = + match rev_extra_args with + | [ (_, p) ] -> Ast_pat.is_unit_cont ~yes:0 ~no:len p + | _ -> len + in + Bs_syntaxerr.err_large_arity loc arity; + let arity_s = string_of_int arity in + Pexp_record + ( [ ({ txt = Ldot (Ast_literal.Lid.js_fn, "I" ^ arity_s); loc }, body) ], + None ) + end module Typemod_hide = struct @@ -152201,22 +152033,6 @@ let expr_mapper ~async_context ~in_function_def (self : mapper) pexp_attributes; }) | Pexp_apply (fn, args) -> Ast_exp_apply.app_exp_mapper e self fn args - | Pexp_object { pcstr_self; pcstr_fields } -> - let pexp_attributes = - match Ast_attributes.process_bs e.pexp_attributes with - | true, pexp_attributes -> - Location.prerr_warning e.pexp_loc - (Bs_ffi_warning "Here @bs attribute not needed any more"); - pexp_attributes - | false, e -> e - in - { - e with - pexp_desc = - Ast_util.ocaml_obj_as_js_object e.pexp_loc self pcstr_self - pcstr_fields; - pexp_attributes; - } | Pexp_match ( b, [ diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml index fb47a3c384..2714d7fb9c 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -160242,166 +160242,6 @@ let pval_prim_of_option_labels (labels : (bool * string Asttypes.loc) list) in External_ffi_types.ffi_obj_as_prims arg_kinds -end -module Ast_uncurry_gen : sig -#1 "ast_uncurry_gen.mli" -(* Copyright (C) 2020- Authors of ReScript - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) - -val to_uncurry_fn : - Location.t -> - Bs_ast_mapper.mapper -> - Asttypes.arg_label -> - Parsetree.pattern -> - Parsetree.expression -> - bool -> (* async *) - Parsetree.expression_desc -(** - [function] can only take one argument, that is the reason we did not adopt it - syntax: - {[ fun [@bs] pat pat1-> body ]} - [to_uncurry_fn (fun pat -> (fun pat1 -> ... body))] - -*) - -val to_method_callback : - Location.t -> - Bs_ast_mapper.mapper -> - Asttypes.arg_label -> - Parsetree.pattern -> - Parsetree.expression -> - Parsetree.expression_desc -(** syntax: - {[fun [@bs.this] obj pat pat1 -> body]} -*) - -end = struct -#1 "ast_uncurry_gen.ml" -(* Copyright (C) 2020- Hongbo Zhang, Authors of ReScript - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) - -open Ast_helper - -(* Handling `fun [@this]` used in `object [@bs] end` *) -let to_method_callback loc (self : Bs_ast_mapper.mapper) label - (self_pat : Parsetree.pattern) body : Parsetree.expression_desc = - let self_pat = self.pat self self_pat in - (match Ast_pat.is_single_variable_pattern_conservative self_pat with - | None -> Bs_syntaxerr.err self_pat.ppat_loc Bs_this_simple_pattern - | Some self -> Stack.push self Js_config.self_stack); - Bs_syntaxerr.optional_err loc label; - let rec aux acc (body : Parsetree.expression) = - match Ast_attributes.process_attributes_rev body.pexp_attributes with - | Nothing, _ -> ( - match body.pexp_desc with - | Pexp_fun (arg_label, _, arg, body) -> - Bs_syntaxerr.optional_err loc arg_label; - aux ((arg_label, self.pat self arg) :: acc) body - | _ -> (self.expr self body, acc)) - | _, _ -> (self.expr self body, acc) - in - let result, rev_extra_args = aux [ (label, self_pat) ] body in - let body = - Ext_list.fold_left rev_extra_args result (fun e (label, p) -> - Ast_helper.Exp.fun_ ~loc label None p e) - in - let arity = List.length rev_extra_args in - let arity_s = string_of_int arity in - Stack.pop Js_config.self_stack |> ignore; - Parsetree.Pexp_apply - ( Exp.ident ~loc - { loc; txt = Ldot (Ast_literal.Lid.js_oo, "unsafe_to_method") }, - [ - ( Nolabel, - Exp.constraint_ ~loc - (Exp.record ~loc - [ ({ loc; txt = Ast_literal.Lid.hidden_field arity_s }, body) ] - None) - (Typ.constr ~loc - { - loc; - txt = Ldot (Ast_literal.Lid.js_meth_callback, "arity" ^ arity_s); - } - [ Typ.any ~loc () ]) ); - ] ) - -let to_uncurry_fn loc (self : Bs_ast_mapper.mapper) (label : Asttypes.arg_label) - pat body async : Parsetree.expression_desc = - Bs_syntaxerr.optional_err loc label; - let rec aux acc (body : Parsetree.expression) = - match Ast_attributes.process_attributes_rev body.pexp_attributes with - | Nothing, _ -> ( - match body.pexp_desc with - | Pexp_fun (arg_label, _, arg, body) -> - Bs_syntaxerr.optional_err loc arg_label; - aux ((arg_label, self.pat self arg) :: acc) body - | _ -> (self.expr self body, acc)) - | _, _ -> (self.expr self body, acc) - in - let first_arg = self.pat self pat in - - let result, rev_extra_args = aux [ (label, first_arg) ] body in - let result = Ast_async.add_promise_type ~async result in - let body = - Ext_list.fold_left rev_extra_args result (fun e (label, p) -> - Ast_helper.Exp.fun_ ~loc label None p e) - in - let body = Ast_async.add_async_attribute ~async body in - - let len = List.length rev_extra_args in - let arity = - match rev_extra_args with - | [ (_, p) ] -> Ast_pat.is_unit_cont ~yes:0 ~no:len p - | _ -> len - in - Bs_syntaxerr.err_large_arity loc arity; - let arity_s = string_of_int arity in - Pexp_record - ( [ ({ txt = Ldot (Ast_literal.Lid.js_fn, "I" ^ arity_s); loc }, body) ], - None ) - end module Ast_util : sig #1 "ast_util.mli" @@ -160443,13 +160283,6 @@ val record_as_js_object : val js_property : Location.t -> Parsetree.expression -> string -> Parsetree.expression_desc -val ocaml_obj_as_js_object : - Location.t -> - Bs_ast_mapper.mapper -> - Parsetree.pattern -> - Parsetree.class_field list -> - Parsetree.expression_desc - end = struct #1 "ast_util.ml" (* Copyright (C) 2015-2016 Bloomberg Finance L.P. @@ -160476,172 +160309,11 @@ end = struct * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -open Ast_helper - type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list let js_property loc obj (name : string) = Parsetree.Pexp_send (obj, { loc; txt = name }) -let ocaml_obj_as_js_object loc (mapper : Bs_ast_mapper.mapper) - (self_pat : Parsetree.pattern) (clfs : Parsetree.class_field list) = - (* Attention: we should avoid type variable conflict for each method - Since the method name is unique, there would be no conflict - OCaml does not allow duplicate instance variable and duplicate methods, - but it does allow duplicates between instance variable and method name, - we should enforce such rules - {[ - object [@bs] - val x = 3 - method x = 3 - end - ]} should not compile with a meaningful error message - *) - let generate_val_method_pair loc (mapper : Bs_ast_mapper.mapper) - (val_name : string Asttypes.loc) is_mutable = - let result = Typ.var ~loc val_name.txt in - ( result, - Parsetree.Otag (val_name, [], result) - :: - (if is_mutable then - [ - Otag - ( { val_name with txt = val_name.txt ^ Literals.setter_suffix }, - [], - Ast_typ_uncurry.to_method_type loc mapper Nolabel result - (Ast_literal.type_unit ~loc ()) ); - ] - else []) ) - in - - (* Note mapper is only for API compatible - * TODO: we should check label name to avoid conflict - *) - - (* we need calculate the real object type - and exposed object type, in some cases there are equivalent - - for public object type its [@meth] it does not depend on itself - while for label argument it is [@this] which depends internal object - *) - let ( (internal_label_attr_types : Parsetree.object_field list), - (public_label_attr_types : Parsetree.object_field list) ) = - Ext_list.fold_right clfs ([], []) - (fun - ({ pcf_loc = loc } as x : Parsetree.class_field) - (label_attr_types, public_label_attr_types) - -> - match x.pcf_desc with - | Pcf_method (label, public_flag, Cfk_concrete (Fresh, e)) -> ( - match e.pexp_desc with - | Pexp_poly ({ pexp_desc = Pexp_fun (lbl, _, pat, e) }, None) -> - let method_type = - Ast_typ_uncurry.generate_arg_type x.pcf_loc mapper label.txt - lbl pat e - in - ( Parsetree.Otag (label, [], method_type) :: label_attr_types, - if public_flag = Public then - Parsetree.Otag (label, [], method_type) - :: public_label_attr_types - else public_label_attr_types ) - | Pexp_poly (_, Some _) -> - Location.raise_errorf ~loc - "polymorphic type annotation not supported yet" - | Pexp_poly (_, None) -> - Location.raise_errorf ~loc - "Unsupported syntax, expect syntax like `method x () = x ` " - | _ -> Location.raise_errorf ~loc "Unsupported syntax in js object") - | Pcf_val (label, mutable_flag, Cfk_concrete (Fresh, _)) -> - let _, label_attr = - generate_val_method_pair x.pcf_loc mapper label - (mutable_flag = Mutable) - in - ( Ext_list.append label_attr label_attr_types, - public_label_attr_types ) - | Pcf_val (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not support currently" - | Pcf_val (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtual flag not support currently" - | Pcf_method (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not supported" - | Pcf_method (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtural method not supported" - | Pcf_inherit _ | Pcf_initializer _ | Pcf_attribute _ | Pcf_extension _ - | Pcf_constraint _ -> - Location.raise_errorf ~loc "Only method support currently") - in - let internal_obj_type = - Ast_core_type.make_obj ~loc internal_label_attr_types - in - let public_obj_type = Ast_core_type.make_obj ~loc public_label_attr_types in - let labels, label_types, exprs, _ = - Ext_list.fold_right clfs ([], [], [], false) - (fun (x : Parsetree.class_field) (labels, label_types, exprs, aliased) -> - match x.pcf_desc with - | Pcf_method (label, _public_flag, Cfk_concrete (Fresh, e)) -> ( - match e.pexp_desc with - | Pexp_poly - (({ pexp_desc = Pexp_fun (ll, None, pat, e) } as f), None) -> - let alias_type = - if aliased then None else Some internal_obj_type - in - let label_type = - Ast_typ_uncurry.generate_method_type ?alias_type x.pcf_loc - mapper label.txt ll pat e - in - ( label :: labels, - label_type :: label_types, - { - f with - pexp_desc = - (let f = Ast_pat.is_unit_cont pat ~yes:e ~no:f in - Ast_uncurry_gen.to_method_callback loc mapper Nolabel - self_pat f) - (* the first argument is this*); - } - :: exprs, - true ) - | Pexp_poly (_, Some _) -> - Location.raise_errorf ~loc - "polymorphic type annotation not supported yet" - | Pexp_poly (_, None) -> - Location.raise_errorf ~loc - "Unsupported syntax, expect syntax like `method x () = x ` " - | _ -> Location.raise_errorf ~loc "Unsupported syntax in js object") - | Pcf_val (label, mutable_flag, Cfk_concrete (Fresh, val_exp)) -> - let label_type, _ = - generate_val_method_pair x.pcf_loc mapper label - (mutable_flag = Mutable) - in - ( label :: labels, - label_type :: label_types, - mapper.expr mapper val_exp :: exprs, - aliased ) - | Pcf_val (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not support currently" - | Pcf_val (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtual flag not support currently" - | Pcf_method (_, _, Cfk_concrete (Override, _)) -> - Location.raise_errorf ~loc "override flag not supported" - | Pcf_method (_, _, Cfk_virtual _) -> - Location.raise_errorf ~loc "virtural method not supported" - | Pcf_inherit _ | Pcf_initializer _ | Pcf_attribute _ | Pcf_extension _ - | Pcf_constraint _ -> - Location.raise_errorf ~loc "Only method support currently") - in - let pval_type = - Ext_list.fold_right2 labels label_types public_obj_type - (fun label label_type acc -> - Ast_compatible.label_arrow ~loc:label.Asttypes.loc label.Asttypes.txt - label_type acc) - in - Ast_external_mk.local_extern_cont_to_obj loc - ~pval_prim:(Ast_external_process.pval_prim_of_labels labels) - (fun e -> - Ast_compatible.apply_labels ~loc e - (Ext_list.map2 labels exprs (fun l expr -> (l.txt, expr)))) - ~pval_type - let record_as_js_object loc (self : Bs_ast_mapper.mapper) (label_exprs : label_exprs) : Parsetree.expression_desc = let labels, args, arity = @@ -162199,6 +161871,166 @@ let value_bindings_mapper (self : Bs_ast_mapper.mapper) Ext_list.fold_right vbs [] (fun vb acc -> flattern_tuple_pattern_vb self vb acc) +end +module Ast_uncurry_gen : sig +#1 "ast_uncurry_gen.mli" +(* Copyright (C) 2020- Authors of ReScript + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + +val to_uncurry_fn : + Location.t -> + Bs_ast_mapper.mapper -> + Asttypes.arg_label -> + Parsetree.pattern -> + Parsetree.expression -> + bool -> (* async *) + Parsetree.expression_desc +(** + [function] can only take one argument, that is the reason we did not adopt it + syntax: + {[ fun [@bs] pat pat1-> body ]} + [to_uncurry_fn (fun pat -> (fun pat1 -> ... body))] + +*) + +val to_method_callback : + Location.t -> + Bs_ast_mapper.mapper -> + Asttypes.arg_label -> + Parsetree.pattern -> + Parsetree.expression -> + Parsetree.expression_desc +(** syntax: + {[fun [@bs.this] obj pat pat1 -> body]} +*) + +end = struct +#1 "ast_uncurry_gen.ml" +(* Copyright (C) 2020- Hongbo Zhang, Authors of ReScript + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + +open Ast_helper + +(* Handling `fun [@this]` used in `object [@bs] end` *) +let to_method_callback loc (self : Bs_ast_mapper.mapper) label + (self_pat : Parsetree.pattern) body : Parsetree.expression_desc = + let self_pat = self.pat self self_pat in + (match Ast_pat.is_single_variable_pattern_conservative self_pat with + | None -> Bs_syntaxerr.err self_pat.ppat_loc Bs_this_simple_pattern + | Some self -> Stack.push self Js_config.self_stack); + Bs_syntaxerr.optional_err loc label; + let rec aux acc (body : Parsetree.expression) = + match Ast_attributes.process_attributes_rev body.pexp_attributes with + | Nothing, _ -> ( + match body.pexp_desc with + | Pexp_fun (arg_label, _, arg, body) -> + Bs_syntaxerr.optional_err loc arg_label; + aux ((arg_label, self.pat self arg) :: acc) body + | _ -> (self.expr self body, acc)) + | _, _ -> (self.expr self body, acc) + in + let result, rev_extra_args = aux [ (label, self_pat) ] body in + let body = + Ext_list.fold_left rev_extra_args result (fun e (label, p) -> + Ast_helper.Exp.fun_ ~loc label None p e) + in + let arity = List.length rev_extra_args in + let arity_s = string_of_int arity in + Stack.pop Js_config.self_stack |> ignore; + Parsetree.Pexp_apply + ( Exp.ident ~loc + { loc; txt = Ldot (Ast_literal.Lid.js_oo, "unsafe_to_method") }, + [ + ( Nolabel, + Exp.constraint_ ~loc + (Exp.record ~loc + [ ({ loc; txt = Ast_literal.Lid.hidden_field arity_s }, body) ] + None) + (Typ.constr ~loc + { + loc; + txt = Ldot (Ast_literal.Lid.js_meth_callback, "arity" ^ arity_s); + } + [ Typ.any ~loc () ]) ); + ] ) + +let to_uncurry_fn loc (self : Bs_ast_mapper.mapper) (label : Asttypes.arg_label) + pat body async : Parsetree.expression_desc = + Bs_syntaxerr.optional_err loc label; + let rec aux acc (body : Parsetree.expression) = + match Ast_attributes.process_attributes_rev body.pexp_attributes with + | Nothing, _ -> ( + match body.pexp_desc with + | Pexp_fun (arg_label, _, arg, body) -> + Bs_syntaxerr.optional_err loc arg_label; + aux ((arg_label, self.pat self arg) :: acc) body + | _ -> (self.expr self body, acc)) + | _, _ -> (self.expr self body, acc) + in + let first_arg = self.pat self pat in + + let result, rev_extra_args = aux [ (label, first_arg) ] body in + let result = Ast_async.add_promise_type ~async result in + let body = + Ext_list.fold_left rev_extra_args result (fun e (label, p) -> + Ast_helper.Exp.fun_ ~loc label None p e) + in + let body = Ast_async.add_async_attribute ~async body in + + let len = List.length rev_extra_args in + let arity = + match rev_extra_args with + | [ (_, p) ] -> Ast_pat.is_unit_cont ~yes:0 ~no:len p + | _ -> len + in + Bs_syntaxerr.err_large_arity loc arity; + let arity_s = string_of_int arity in + Pexp_record + ( [ ({ txt = Ldot (Ast_literal.Lid.js_fn, "I" ^ arity_s); loc }, body) ], + None ) + end module Typemod_hide = struct @@ -162485,22 +162317,6 @@ let expr_mapper ~async_context ~in_function_def (self : mapper) pexp_attributes; }) | Pexp_apply (fn, args) -> Ast_exp_apply.app_exp_mapper e self fn args - | Pexp_object { pcstr_self; pcstr_fields } -> - let pexp_attributes = - match Ast_attributes.process_bs e.pexp_attributes with - | true, pexp_attributes -> - Location.prerr_warning e.pexp_loc - (Bs_ffi_warning "Here @bs attribute not needed any more"); - pexp_attributes - | false, e -> e - in - { - e with - pexp_desc = - Ast_util.ocaml_obj_as_js_object e.pexp_loc self pcstr_self - pcstr_fields; - pexp_attributes; - } | Pexp_match ( b, [