diff --git a/src/parser_utils/exports/exports.ml b/src/parser_utils/exports/exports.ml index 2e838cf06b1..a8e1795b793 100644 --- a/src/parser_utils/exports/exports.ml +++ b/src/parser_utils/exports/exports.ml @@ -314,7 +314,6 @@ module ESM = struct export_keys; type_stars; stars; - module_globals = _; strict = _; platform_availability_set = _; } @@ -410,15 +409,8 @@ module CJS = struct NamedType name :: acc let exports type_sig type_exports exports info = - let (CJSModuleInfo - { - type_export_keys; - type_stars; - module_globals = _; - strict = _; - platform_availability_set = _; - } - ) = + let (CJSModuleInfo { type_export_keys; type_stars; strict = _; platform_availability_set = _ }) + = info in let acc = diff --git a/src/parser_utils/type_sig/__tests__/type_sig_tests.ml b/src/parser_utils/type_sig/__tests__/type_sig_tests.ml index cd2fffdaf0a..d7c1121f3f8 100644 --- a/src/parser_utils/type_sig/__tests__/type_sig_tests.ml +++ b/src/parser_utils/type_sig/__tests__/type_sig_tests.ml @@ -320,8 +320,7 @@ let%expect_test "export_number_literal" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "export_bigint_literal" = @@ -337,8 +336,7 @@ let%expect_test "export_bigint_literal" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "export_bigint_literal_neg" = @@ -356,8 +354,7 @@ let%expect_test "export_bigint_literal_neg" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "export_function_literal" = @@ -383,8 +380,7 @@ let%expect_test "export_function_literal" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "export_function_literal_check1" = @@ -410,8 +406,7 @@ let%expect_test "export_function_literal_check1" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Errors: (SigError (Signature_error.ExpectedAnnotation ([1:24-25], Expected_annotation_sort.Identifier))) @@ -440,8 +435,7 @@ let%expect_test "export_function_literal_check2" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Errors: (SigError @@ -462,8 +456,7 @@ let%expect_test "export_function_reference" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:9-12]; @@ -492,8 +485,7 @@ let%expect_test "export_function_reference_check1" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:9-12]; @@ -524,8 +516,7 @@ let%expect_test "export_function_reference_check2" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:9-12]; @@ -568,8 +559,7 @@ let%expect_test "function_param_optional" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "function_param_default" = print_sig {| @@ -595,8 +585,7 @@ let%expect_test "function_param_default" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "function_param_default_check" = print_sig {| @@ -621,8 +610,7 @@ let%expect_test "function_param_default_check" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Errors: (SigError (Signature_error.ExpectedAnnotation ([1:24-25], Expected_annotation_sort.Identifier))) @@ -684,8 +672,7 @@ let%expect_test "function_param_typeof_reference" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:14-17]; name = "bar"; def = (Annot (String [1:19-25]))} @@ -716,8 +703,7 @@ let%expect_test "component_param_typeof_reference" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"C"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:14-17]; name = "bar"; def = (Annot (String [1:19-25]))} @@ -784,8 +770,7 @@ let%expect_test "export_object_literal_property_literal" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "export_object_literal_property_reference" = @@ -809,8 +794,7 @@ let%expect_test "export_object_literal_property_reference" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:4-5]; name = "x"; def = (Annot (Number [1:7-13]))} @@ -837,8 +821,7 @@ let%expect_test "export_object_literal_property_reference_check" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:4-5]; name = "x"; def = (Err [1:4-5])} @@ -862,8 +845,7 @@ let%expect_test "empty_object_literal" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "export_class_reference" = @@ -883,8 +865,7 @@ let%expect_test "export_class_reference" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -924,8 +905,7 @@ let%expect_test "export_class_reference_check1" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -966,8 +946,7 @@ let%expect_test "export_class_reference_check2" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -1010,8 +989,7 @@ let%expect_test "export_class_reference_check3" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -1058,8 +1036,7 @@ let%expect_test "type_alias_dependencies" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:5-7]; name = "T1"; tparams = Mono; body = (Annot (Number [1:10-16]))} @@ -1108,8 +1085,7 @@ let%expect_test "class_dependencies" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -1163,8 +1139,7 @@ let%expect_test "class_dependencies_check" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -1220,8 +1195,7 @@ let%expect_test "export_new_typecast" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -1275,8 +1249,7 @@ let%expect_test "export_new_typecast_check" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -1331,8 +1304,7 @@ let%expect_test "recursive_dependencies" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -1377,8 +1349,7 @@ let%expect_test "recursive_dependencies_check" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -1423,8 +1394,7 @@ let%expect_test "typeof_dependencies" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:4-5]; name = "x"; def = (Annot (Number [1:7-13]))} @@ -1461,8 +1431,7 @@ let%expect_test "typeof_dependencies_check" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:4-5]; name = "x"; def = (Err [1:4-5])} @@ -1508,8 +1477,7 @@ let%expect_test "const_initializer" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:6-7]; name = "x"; def = (Value (NumberLit ([1:10-11], 0., "0")))} @@ -1525,8 +1493,7 @@ let%expect_test "empty_array_literal" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Errors: (SigError (Signature_error.EmptyArray [1:15-18])) @@ -1550,8 +1517,7 @@ let%expect_test "non_empty_array_literal" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:6-7]; name = "x"; def = (Value (NumberLit ([1:10-11], 0., "0")))} @@ -1577,8 +1543,7 @@ let%expect_test "void_function" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:9-12]; @@ -1606,8 +1571,7 @@ let%expect_test "void_generator" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:10-13]; @@ -1642,8 +1606,7 @@ let%expect_test "import_default_dependencies" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Module refs: 0. ./import_default_dependencies_helper @@ -1686,8 +1649,7 @@ let%expect_test "import_type_dependencies" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Module refs: 0. ./import_type_dependencies_helper @@ -1741,8 +1703,7 @@ let%expect_test "qualified_references" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Module refs: 0. ./qualified_references_helper @@ -1793,9 +1754,8 @@ let%expect_test "invalid_qualified_references" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -1830,9 +1790,8 @@ let%expect_test "hoisted_requires" = exports = (Some (Ref LocalRef {ref_loc = [11:17-18]; index = 2})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Module refs: 0. ./hoisted_requires_helper @@ -1883,9 +1842,8 @@ let%expect_test "hoisted_locals" = exports = (Some (Ref LocalRef {ref_loc = [10:17-18]; index = 2})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Module refs: 0. ./hoisted_locals_helper @@ -1921,9 +1879,8 @@ let%expect_test "dynamic_requires" = CJSModule {type_exports = [||]; exports = (Some Require {loc = [1:17-53]; index = 0}); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Module refs: 0. ./dynamic_requires_helper @@ -1937,9 +1894,8 @@ let%expect_test "import_dynamic" = CJSModule {type_exports = [||]; exports = (Some ImportDynamic {loc = [1:17-30]; index = 0}); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Module refs: 0. foo |}] @@ -1952,9 +1908,8 @@ let%expect_test "enable_relay_integration" = CJSModule {type_exports = [||]; exports = (Some Require {loc = [1:17-38]; index = 0}); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Module refs: 0. foo.graphql |}] @@ -1967,9 +1922,8 @@ let%expect_test "relay_integration_module_prefix" = CJSModule {type_exports = [||]; exports = (Some Require {loc = [1:17-38]; index = 0}); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Module refs: 0. ./__generated__/foo.graphql |}] @@ -1990,9 +1944,8 @@ let%expect_test "scope_extrusion" = exports = (Some (Ref LocalRef {ref_loc = [8:17-18]; index = 1})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [2:8-9]; @@ -2035,9 +1988,8 @@ let%expect_test "scope_extrusion_nested" = Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [2:8-9]; @@ -2088,9 +2040,8 @@ let%expect_test "report_all_errors" = Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -2139,8 +2090,7 @@ let%expect_test "munged_methods_ignored_if_directive" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -2167,8 +2117,7 @@ let%expect_test "munged_methods_not_ignored" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -2209,8 +2158,7 @@ let%expect_test "munged_fields_ignored_if_directive" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -2237,8 +2185,7 @@ let%expect_test "munged_fields_not_ignored" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -2284,8 +2231,7 @@ let%expect_test "propTypes_static_failure" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -2309,9 +2255,8 @@ let%expect_test "array_spread" = CJSModule {type_exports = [||]; exports = (Some (Err [1:17-34])); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Errors: (SigError (Signature_error.UnexpectedArraySpread ([1:17-34], [1:21-30]))) @@ -2325,9 +2270,8 @@ let%expect_test "array_hole" = CJSModule {type_exports = [||]; exports = (Some (Err [1:17-20])); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Errors: (SigError (Signature_error.UnexpectedArrayHole [1:17-20])) @@ -2364,9 +2308,8 @@ let%expect_test "object_spread" = ])})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "reference_expression1" = @@ -2381,9 +2324,8 @@ let%expect_test "reference_expression1" = (GetProp "NaN")))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "reference_expression2" = @@ -2394,9 +2336,8 @@ let%expect_test "reference_expression2" = CJSModule {type_exports = [||]; exports = (Some (Err [1:17-27])); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Errors: (SigError @@ -2414,9 +2355,8 @@ let%expect_test "member_expression" = (GetElem (Value (NumberLit ([1:19-20], 0., "0"))))))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "arith_expression1" = print_sig {| @@ -2430,9 +2370,8 @@ let%expect_test "arith_expression1" = ))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "arith_expression2" = @@ -2447,9 +2386,8 @@ let%expect_test "arith_expression2" = ))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "update_expression" = @@ -2466,8 +2404,7 @@ let%expect_test "update_expression" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"post_decr"; "post_incr"; "pre_decr"; "pre_incr"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Module refs: 0. bar @@ -2500,8 +2437,7 @@ let%expect_test "sequence_expression" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + stars = []; strict = true; platform_availability_set = None}} |}] let%expect_test "named_class_expression" = print_sig {| @@ -2512,9 +2448,8 @@ let%expect_test "named_class_expression" = exports = (Some (Ref LocalRef {ref_loc = [1:23-24]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:23-24]; @@ -2534,9 +2469,8 @@ let%expect_test "named_function_expression" = exports = (Some (Ref LocalRef {ref_loc = [1:26-29]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:26-29]; @@ -2562,8 +2496,7 @@ let%expect_test "interface_coverage" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"C"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Interface {id_loc = [1:18-21]; @@ -2603,9 +2536,8 @@ let%expect_test "bound_coverage" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:5-8]; name = "Foo"; tparams = Mono; body = (Annot (Number [1:11-17]))} @@ -2640,9 +2572,8 @@ let%expect_test "recursive_class_coverage" = exports = (Some (Ref LocalRef {ref_loc = [1:23-24]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:23-24]; @@ -2667,9 +2598,8 @@ let%expect_test "shadowed_class_expression" = exports = (Some (Ref LocalRef {ref_loc = [2:23-24]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [2:23-24]; @@ -2699,9 +2629,8 @@ let%expect_test "frozen_object" = Annot (SingletonNumber ([1:38-40], 42., "42"))), Polarity.Positive)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "frozen_object_empty" = @@ -2713,9 +2642,8 @@ let%expect_test "frozen_object_empty" = exports = (Some (Value ObjLit {loc = [1:31-33]; frozen = true; proto = None; props = {}})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "fbt_empty_open_close" = print_sig ~facebook_fbt:"FbtElement" {| @@ -2728,9 +2656,8 @@ let%expect_test "fbt_empty_open_close" = (Unqualified BuiltinRef {ref_loc = [1:18-21]; type_ref = true; name = "FbtElement"}))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "fbt_empty_open" = @@ -2744,9 +2671,8 @@ let%expect_test "fbt_empty_open" = (Unqualified BuiltinRef {ref_loc = [1:18-21]; type_ref = true; name = "FbtElement"}))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "fbt_with_child" = @@ -2761,9 +2687,8 @@ let%expect_test "fbt_with_child" = (Unqualified BuiltinRef {ref_loc = [2:18-21]; type_ref = true; name = "FbtElement"}))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "keymirror" = @@ -2788,9 +2713,8 @@ let%expect_test "keymirror" = Annot (SingletonString ([3:2-3], "b"))), Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "jsx_div" = @@ -2801,9 +2725,8 @@ let%expect_test "jsx_div" = CJSModule {type_exports = [||]; exports = (Some (Err [1:17-28])); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Errors: (SigError @@ -2820,8 +2743,7 @@ let%expect_test "function_return" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"foo"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:4-5]; name = "n"; def = (Err [1:4-5])} @@ -2867,8 +2789,7 @@ let%expect_test "function_return_2" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"bar"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:4-5]; name = "n"; def = (Err [1:4-5])} @@ -2924,9 +2845,8 @@ let%expect_test "function_statics" = exports = (Some (Ref LocalRef {ref_loc = [4:17-20]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:9-12]; @@ -2954,8 +2874,7 @@ let%expect_test "function_statics_conditional" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"bar"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:16-19]; @@ -2981,8 +2900,7 @@ let%expect_test "function_predicates" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"foo"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [2:16-19]; @@ -3006,9 +2924,8 @@ let%expect_test "async_function_1" = exports = (Some (Ref LocalRef {ref_loc = [2:17-20]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:15-18]; @@ -3032,9 +2949,8 @@ let%expect_test "async_function_2" = exports = (Some (Ref LocalRef {ref_loc = [2:17-20]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:15-18]; @@ -3072,9 +2988,8 @@ let%expect_test "async_function_3" = statics = {}})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Errors: (SigError @@ -3092,9 +3007,8 @@ let%expect_test "type_spread" = exports = None; info = CJSModuleInfo {type_export_keys = [|"C"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:5-6]; name = "A"; @@ -3141,9 +3055,8 @@ let%expect_test "inline_interface" = exports = None; info = CJSModuleInfo {type_export_keys = [|"B"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:5-6]; name = "A"; @@ -3176,9 +3089,8 @@ let%expect_test "object_annot_optional" = exports = None; info = CJSModuleInfo {type_export_keys = [|"A"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3202,9 +3114,8 @@ let%expect_test "interface_optional" = exports = None; info = CJSModuleInfo {type_export_keys = [|"I"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. Interface {id_loc = [1:17-18]; @@ -3226,9 +3137,8 @@ let%expect_test "interface_method" = exports = None; info = CJSModuleInfo {type_export_keys = [|"I"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. Interface {id_loc = [1:17-18]; @@ -3258,9 +3168,8 @@ let%expect_test "interface_indexer" = exports = None; info = CJSModuleInfo {type_export_keys = [|"I"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. Interface {id_loc = [1:17-18]; @@ -3283,9 +3192,8 @@ let%expect_test "object_annot_method" = exports = None; info = CJSModuleInfo {type_export_keys = [|"A"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3316,9 +3224,8 @@ let%expect_test "object_annot_call_poly" = exports = None; info = CJSModuleInfo {type_export_keys = [|"A"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3369,9 +3276,8 @@ let%expect_test "object_annot_multiple_call" = exports = None; info = CJSModuleInfo {type_export_keys = [|"A"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3417,8 +3323,7 @@ let%expect_test "destruct_object_shared" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"a"; "c"; "d"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:14-15]; name = "a"; def = (Pattern 1)} @@ -3446,8 +3351,7 @@ let%expect_test "destruct_array_shared" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"a"; "b"; "c"; "d"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:14-15]; name = "a"; def = (Pattern 1)} @@ -3476,9 +3380,8 @@ let%expect_test "tuple_annot" = exports = None; info = CJSModuleInfo {type_export_keys = [|"A"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3508,9 +3411,8 @@ let%expect_test "tuple_annot_labeled" = exports = None; info = CJSModuleInfo {type_export_keys = [|"A"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3542,9 +3444,8 @@ let%expect_test "tuple_annot_variance" = exports = None; info = CJSModuleInfo {type_export_keys = [|"A"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3576,9 +3477,8 @@ let%expect_test "tuple_annot_inexact" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3596,9 +3496,8 @@ let%expect_test "cycle" = exports = None; info = CJSModuleInfo {type_export_keys = [|"A"; "B"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3640,8 +3539,7 @@ let%expect_test "typeof loc" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"a"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:11-12]; @@ -3667,8 +3565,7 @@ let%expect_test "qualified_generic_typeapp_loc" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"a"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:19-20]; @@ -3697,8 +3594,7 @@ let%expect_test "export_ref_renaming" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"b"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:12-13]; name = "a"; def = (Annot (String [1:15-21]))} |}] @@ -3712,8 +3608,7 @@ let%expect_test "union_annot" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"a"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:19-20]; @@ -3733,8 +3628,7 @@ let%expect_test "intersection_annot" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"a"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:19-20]; @@ -3761,8 +3655,7 @@ let%expect_test "class_extends" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"C1"; "C2"; "C3"; "C4"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DeclareClassBinding {id_loc = [1:14-15]; @@ -3835,8 +3728,7 @@ let%expect_test "class_this" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"C"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:13-14]; @@ -3867,8 +3759,7 @@ let%expect_test "declare_class_this" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"C"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DeclareClassBinding {id_loc = [1:21-22]; @@ -3911,8 +3802,7 @@ let%expect_test "existential" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:6-7]; @@ -3940,9 +3830,8 @@ let%expect_test "exact_by_default" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -3975,9 +3864,8 @@ let%expect_test "cjs_export_props" = Value (NumberLit ([1:21-22], 0., "0"))), Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "cjs_exports_clobber_shadowed_module_global" = print_sig {| @@ -3988,9 +3876,8 @@ let%expect_test "cjs_exports_clobber_shadowed_module_global" = CJSModule {type_exports = [||]; exports = None; info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "cjs_exports_assign_shadowed_exports_global" = print_sig {| @@ -4001,9 +3888,8 @@ let%expect_test "cjs_exports_assign_shadowed_exports_global" = CJSModule {type_exports = [||]; exports = None; info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "cjs_exports_assign_shadowed_module_global" = print_sig {| @@ -4014,9 +3900,8 @@ let%expect_test "cjs_exports_assign_shadowed_module_global" = CJSModule {type_exports = [||]; exports = None; info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "cjs_export_shadowed_hoisted_TODO" = print_sig {| @@ -4035,9 +3920,8 @@ let%expect_test "cjs_export_shadowed_hoisted_TODO" = Value (NumberLit ([1:21-22], 0., "0"))), Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "cjs_export_fun_expr_props" = @@ -4064,9 +3948,8 @@ let%expect_test "cjs_export_fun_expr_props" = "foo" -> ([2:15-18], (Value (NumberLit ([2:21-22], 0., "0")))) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "cjs_export_fun_binding_props" = print_sig {| @@ -4079,9 +3962,8 @@ let%expect_test "cjs_export_fun_binding_props" = exports = (Some (Ref LocalRef {ref_loc = [1:26-29]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:26-29]; @@ -4106,8 +3988,7 @@ let%expect_test "es_export_named_fun_props" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"foo"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:16-19]; @@ -4131,8 +4012,7 @@ let%expect_test "es_export_default_fun_props" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:24-27]; @@ -4156,9 +4036,8 @@ let%expect_test "fun_binding_assign" = exports = (Some (Ref LocalRef {ref_loc = [3:17-20]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:9-12]; @@ -4182,9 +4061,8 @@ let%expect_test "fun_const_assign" = exports = (Some (Ref LocalRef {ref_loc = [3:17-20]; index = 0})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:6-9]; name = "foo"; @@ -4210,9 +4088,8 @@ let%expect_test "ref_const_assign" = exports = (Some (Ref LocalRef {ref_loc = [3:17-20]; index = 1})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:21-22]; @@ -4236,8 +4113,7 @@ let%expect_test "obj_annot_proto" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"o"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:19-20]; @@ -4276,8 +4152,7 @@ let%expect_test "getter_setter" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"a"; "b"; "c"; "d"; "e"; "f"; "g"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:13-14]; @@ -4356,8 +4231,7 @@ let%expect_test "export_default_function_binding" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:24-25]; @@ -4380,8 +4254,7 @@ let%expect_test "export_default_class_binding" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:21-22]; @@ -4401,8 +4274,7 @@ let%expect_test "declared_export_default_function_binding" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DeclareFun {id_loc = [1:32-33]; @@ -4424,8 +4296,7 @@ let%expect_test "declared_export_default_class_binding" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DeclareClassBinding {id_loc = [1:29-30]; @@ -4447,9 +4318,8 @@ let%expect_test "module_ref_prefix" = exports = (Some ModuleRef {loc = [1:17-24]; index = 0; legacy_interop = false}); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Module refs: 0. foo |}] @@ -4463,8 +4333,7 @@ let%expect_test "enum_export" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:12-13]; @@ -4482,8 +4351,7 @@ let%expect_test "enum_default_export" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:20-21]; @@ -4503,8 +4371,7 @@ let%expect_test "enum_stmt" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:5-6]; @@ -4521,8 +4388,7 @@ let%expect_test "enum_bool_lit" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:12-13]; @@ -4539,8 +4405,7 @@ let%expect_test "enum_bool" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:12-13]; @@ -4557,8 +4422,7 @@ let%expect_test "enum_number_truthy" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:12-13]; @@ -4575,8 +4439,7 @@ let%expect_test "enum_number_any" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:12-13]; @@ -4593,8 +4456,7 @@ let%expect_test "enum_string_any" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:12-13]; @@ -4611,8 +4473,7 @@ let%expect_test "enum_symbol" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:12-13]; @@ -4629,8 +4490,7 @@ let%expect_test "enum_unknown_members" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:12-13]; @@ -4647,8 +4507,7 @@ let%expect_test "enum_declared" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. EnumBinding {id_loc = [1:20-21]; @@ -4665,8 +4524,7 @@ let%expect_test "enum_disabled" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"E"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DisabledEnumBinding {id_loc = [1:12-13]; name = "E"} |}] @@ -4770,9 +4628,8 @@ let%expect_test "builtin_cjs_module" = exports = (Some (TyRef (Unqualified LocalRef {ref_loc = [3:26-27]; index = 0}))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_cjs_ignore_later" = print_builtins [{| @@ -4799,9 +4656,8 @@ let%expect_test "builtin_cjs_ignore_later" = exports = (Some (Annot (String [3:26-32]))); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_cjs_module_auto_export_type" = (* All types in cjs modules are auto exported. *) @@ -4831,9 +4687,8 @@ let%expect_test "builtin_cjs_module_auto_export_type" = exports = (Some (Annot (String [4:26-32]))); info = CJSModuleInfo {type_export_keys = [|"T1"; "T2"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_cjs_module_unused_type_exported" = (* T is exported because it has an `export` keyword *) @@ -4857,9 +4712,8 @@ let%expect_test "builtin_cjs_module_unused_type_exported" = exports = (Some (Annot (String [3:26-32]))); info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_cjs_module_used_type" = (* T is included because it is reachable, but not a named export because it does not @@ -4884,9 +4738,8 @@ let%expect_test "builtin_cjs_module_used_type" = exports = (Some (TyRef (Unqualified LocalRef {ref_loc = [3:26-27]; index = 0}))); info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_cjs_module_used_type_exported" = (* `T` is exported because it has an `export` keyword, and is also reachable via the default export *) @@ -4910,9 +4763,8 @@ let%expect_test "builtin_cjs_module_used_type_exported" = exports = (Some (TyRef (Unqualified LocalRef {ref_loc = [3:26-27]; index = 0}))); info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_cjs_module_with_implicit_exports" = (* when a `declare module` doesn't have explicit value exports via `declare export` (which @@ -5023,9 +4875,8 @@ let%expect_test "builtin_cjs_module_with_implicit_exports" = )) }})); info = CJSModuleInfo {type_export_keys = [|"T"; "U"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_es_module_default" = print_builtins [{| @@ -5048,9 +4899,8 @@ let%expect_test "builtin_es_module_default" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"default"|]; - stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_module_import_typeof" = print_builtins [{| @@ -5085,18 +4935,16 @@ let%expect_test "builtin_module_import_typeof" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"y"|]; - stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; + platform_availability_set = None}} Builtin module foo: [1:15-18] ESModule {type_exports = [||]; exports = [|(ExportBinding 0)|]; info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"x"|]; - stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_toplevel_import" = (* this should be a parse error, but in the meantime, make sure we don't fatal. @@ -5128,18 +4976,16 @@ let%expect_test "builtin_toplevel_import" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"y"|]; - stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; + platform_availability_set = None}} Builtin module foo: [1:15-18] ESModule {type_exports = [||]; exports = [|(ExportBinding 0)|]; info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"x"|]; - stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_module_export_specifiers" = print_builtins [{| @@ -5167,9 +5013,8 @@ let%expect_test "builtin_module_export_specifiers" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"x"; "y"|]; - stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "builtin_declare_namespace" = print_builtins [{| @@ -5392,8 +5237,7 @@ let%expect_test "this_param_1" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"foo"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. FunBinding {id_loc = [1:16-19]; @@ -5417,8 +5261,7 @@ let%expect_test "this_param_2" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"A"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ClassBinding {id_loc = [1:13-14]; @@ -5448,8 +5291,7 @@ let%expect_test "this_param_3" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"foo"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DeclareFun {id_loc = [1:24-27]; @@ -5472,8 +5314,7 @@ let%expect_test "this_param_4" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"A"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DeclareClassBinding {id_loc = [1:21-22]; @@ -5506,9 +5347,8 @@ let%expect_test "this_param_5" = exports = None; info = CJSModuleInfo {type_export_keys = [|"Foo"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-15]; @@ -5532,9 +5372,8 @@ let%expect_test "this_param_6" = exports = None; info = CJSModuleInfo {type_export_keys = [|"O"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -5569,9 +5408,8 @@ let%expect_test "optional_indexed_access" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -5606,7 +5444,6 @@ let%expect_test "cjs_export_type_star" = info = CJSModuleInfo {type_export_keys = [||]; type_stars = [([2:12-13], 1); ([1:12-13], 0)]; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; strict = true; platform_availability_set = None}} Module refs: @@ -5626,7 +5463,6 @@ let%expect_test "es_export_star" = ESModuleInfo {type_export_keys = [||]; type_stars = [([2:12-13], 1); ([1:12-13], 0)]; export_keys = [||]; stars = [([4:7-8], 3); ([3:7-8], 2)]; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; strict = true; platform_availability_set = None}} Module refs: @@ -5644,9 +5480,8 @@ let%expect_test "duplicate_binding" = CJSModule {type_exports = [||]; exports = None; info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "duplicate_binding2" = print_sig {| @@ -5658,8 +5493,7 @@ let%expect_test "duplicate_binding2" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"bar"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [2:17-20]; name = "bar"; def = (Pattern 1)} @@ -5686,9 +5520,8 @@ let%expect_test "duplicate_binding2" = CJSModule {type_exports = [||]; exports = None; info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} |}] + type_stars = []; strict = true; + platform_availability_set = None}} |}] let%expect_test "fun_shadow_declare_fun" = print_sig {| @@ -5701,8 +5534,7 @@ let%expect_test "fun_shadow_declare_fun" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"f"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DeclareFun {id_loc = [1:17-18]; @@ -5731,9 +5563,8 @@ let%expect_test "optional_tuple_elements" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -5765,9 +5596,8 @@ let%expect_test "tuple_spread" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:5-6]; name = "S"; @@ -5820,9 +5650,8 @@ let%expect_test "mapped_types" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T1"; "T2"; "T3"; "T4"; "T5"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:5-6]; name = "O"; @@ -5937,9 +5766,8 @@ let%expect_test "mapped_types_invalid" = exports = None; info = CJSModuleInfo {type_export_keys = [|"T"; "U"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [2:12-13]; name = "T"; tparams = Mono; body = (Annot (Any [2:17-43]))} @@ -5961,8 +5789,7 @@ export const {foo} = {foo: 3}; info = ESModuleInfo {type_export_keys = [|"OOOOOO"|]; type_stars = []; export_keys = [|"aaaaa"; "foo"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: (dirty) 0. TypeAlias {id_loc = [1:12-18]; @@ -6025,9 +5852,8 @@ let%expect_test "component" = Ref LocalRef {ref_loc = [2:19-22]; index = 0}), Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ComponentBinding {id_loc = [1:10-13]; @@ -6057,9 +5883,8 @@ let%expect_test "component2" = Ref LocalRef {ref_loc = [3:19-22]; index = 1}), Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:5-9]; name = "Rest"; @@ -6104,9 +5929,8 @@ let%expect_test "component3" = Ref LocalRef {ref_loc = [4:19-22]; index = 1}), Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ComponentBinding {id_loc = [1:10-17]; @@ -6154,9 +5978,8 @@ let%expect_test "component4" = Ref LocalRef {ref_loc = [2:19-22]; index = 0}), Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. ComponentBinding {id_loc = [1:10-13]; @@ -6193,8 +6016,7 @@ let%expect_test "component_5" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"Baz"; "default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ComponentBinding {id_loc = [1:17-20]; @@ -6229,9 +6051,8 @@ let%expect_test "component_disabled" = Ref LocalRef {ref_loc = [2:19-22]; index = 0}), Polarity.Neutral)) }})); info = CJSModuleInfo {type_export_keys = [||]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. DisabledComponentBinding {id_loc = [1:10-13]; name = "Baz"} @@ -6249,8 +6070,7 @@ let%expect_test "component_disabled2" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"Baz"; "default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. DisabledComponentBinding {id_loc = [1:17-20]; name = "Baz"} @@ -6269,8 +6089,7 @@ let%expect_test "declare_component" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"Baz"; "default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. ComponentBinding {id_loc = [1:25-28]; @@ -6307,8 +6126,7 @@ let%expect_test "component_type" = info = ESModuleInfo {type_export_keys = [|"Mono"; "Poly"|]; type_stars = []; export_keys = [|"Baz"; "default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:5-6]; name = "A"; tparams = Mono; body = (Annot (Number [1:9-15]))} @@ -6395,8 +6213,7 @@ let%expect_test "declare_component" = info = ESModuleInfo {type_export_keys = [||]; type_stars = []; export_keys = [|"Baz"; "default"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. Variable {id_loc = [1:19-22]; @@ -6430,9 +6247,8 @@ let%expect_test "render_types" = exports = None; info = CJSModuleInfo {type_export_keys = [|"X"; "Y"; "Z"|]; - type_stars = []; - module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + type_stars = []; strict = true; + platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; @@ -6488,8 +6304,7 @@ let%expect_test "render_maybe_types" = info = ESModuleInfo {type_export_keys = [|"C"; "X"; "Y"; "Z"|]; type_stars = []; export_keys = [|"Bar"; "Foo"|]; - stars = []; module_globals = ModuleGlobals {global_types = [||]; global_types_keys = [||]}; - strict = true; platform_availability_set = None}} + stars = []; strict = true; platform_availability_set = None}} Local defs: 0. TypeAlias {id_loc = [1:12-13]; diff --git a/src/parser_utils/type_sig/type_sig_mark.ml b/src/parser_utils/type_sig/type_sig_mark.ml index 123bd645d0f..bf23be36a38 100644 --- a/src/parser_utils/type_sig/type_sig_mark.ml +++ b/src/parser_utils/type_sig/type_sig_mark.ml @@ -239,11 +239,9 @@ let mark_star (loc, mref) = let mark_exports ~locs_to_dirtify file_loc - (P.Exports { kind; types; type_stars; global_types; strict = _; platform_availability_set = _ }) - = + (P.Exports { kind; types; type_stars; strict = _; platform_availability_set = _ }) = SMap.iter (fun _ t -> mark_export_type ~locs_to_dirtify t) types; List.iter mark_star type_stars; - SMap.iter (fun _ -> mark_binding ~locs_to_dirtify) global_types; match kind with | P.UnknownModule -> () | P.CJSModule t -> mark_parsed ~locs_to_dirtify ~visit_loc:ignore t diff --git a/src/parser_utils/type_sig/type_sig_pack.ml b/src/parser_utils/type_sig/type_sig_pack.ml index 62dc6732432..db47ff898d2 100644 --- a/src/parser_utils/type_sig/type_sig_pack.ml +++ b/src/parser_utils/type_sig/type_sig_pack.ml @@ -162,18 +162,10 @@ type 'loc type_export = | ExportTypeFrom of Remote_refs.index [@@deriving map, show { with_path = false }] -type module_globals = - | ModuleGlobals of { - global_types: Local_defs.index array; - global_types_keys: string array; - } -[@@deriving show { with_path = false }] - type 'loc cjs_module_info = | CJSModuleInfo of { type_export_keys: string array; type_stars: ('loc * Module_refs.index) list; - module_globals: module_globals; strict: bool; platform_availability_set: Platform_set.t option; } @@ -185,7 +177,6 @@ type 'loc es_module_info = type_stars: ('loc * Module_refs.index) list; export_keys: string array; stars: ('loc * Module_refs.index) list; - module_globals: module_globals; strict: bool; platform_availability_set: Platform_set.t option; } @@ -436,24 +427,16 @@ and pack_exports cx file_loc module_name - (P.Exports { kind; types; type_stars; global_types; strict; platform_availability_set }) = + (P.Exports { kind; types; type_stars; strict; platform_availability_set }) = let (type_export_keys, type_exports) = pack_smap pack_type_export types in let type_stars = List.map pack_star type_stars in match kind with | P.UnknownModule -> - let module_globals = pack_module_globals global_types in - let info = - CJSModuleInfo - { type_export_keys; type_stars; module_globals; strict; platform_availability_set } - in + let info = CJSModuleInfo { type_export_keys; type_stars; strict; platform_availability_set } in CJSModule { type_exports; exports = None; info } | P.CJSModule t -> let exports = Some (pack_parsed cx t) in - let module_globals = pack_module_globals global_types in - let info = - CJSModuleInfo - { type_export_keys; type_stars; module_globals; strict; platform_availability_set } - in + let info = CJSModuleInfo { type_export_keys; type_stars; strict; platform_availability_set } in CJSModule { type_exports; exports; info } | P.CJSModuleProps props -> let file_loc = pack_loc file_loc in @@ -466,11 +449,7 @@ and pack_exports props in let exports = Some (Value (ObjLit { loc = file_loc; frozen = true; proto = None; props })) in - let module_globals = pack_module_globals global_types in - let info = - CJSModuleInfo - { type_export_keys; type_stars; module_globals; strict; platform_availability_set } - in + let info = CJSModuleInfo { type_export_keys; type_stars; strict; platform_availability_set } in CJSModule { type_exports; exports; info } | P.CJSDeclareModule props -> let file_loc = pack_loc file_loc in @@ -485,27 +464,14 @@ and pack_exports let exports = Some (Value (DeclareModuleImplicitlyExportedObject { loc = file_loc; module_name; props })) in - let module_globals = pack_module_globals global_types in - let info = - CJSModuleInfo - { type_export_keys; type_stars; module_globals; strict; platform_availability_set } - in + let info = CJSModuleInfo { type_export_keys; type_stars; strict; platform_availability_set } in CJSModule { type_exports; exports; info } | P.ESModule { names; stars } -> let (export_keys, exports) = pack_smap (pack_export cx) names in let stars = List.map pack_star stars in - let module_globals = pack_module_globals global_types in let info = ESModuleInfo - { - type_export_keys; - type_stars; - export_keys; - stars; - module_globals; - strict; - platform_availability_set; - } + { type_export_keys; type_stars; export_keys; stars; strict; platform_availability_set } in ESModule { type_exports; exports; info } @@ -563,10 +529,6 @@ and pack_builtin = function | P.LocalBinding b -> Local_defs.index_exn b | P.RemoteBinding _ -> failwith "unexpected remote builtin" -and pack_module_globals global_types = - let (global_types_keys, global_types) = pack_smap pack_builtin global_types in - ModuleGlobals { global_types_keys; global_types } - and pack_builtin_module cx name (loc, exports) = let module_kind = pack_exports cx loc name exports in let loc = pack_loc loc in diff --git a/src/parser_utils/type_sig/type_sig_parse.ml b/src/parser_utils/type_sig/type_sig_parse.ml index 7e23b72e56a..0a8ec8fe490 100644 --- a/src/parser_utils/type_sig/type_sig_parse.ml +++ b/src/parser_utils/type_sig/type_sig_parse.ml @@ -127,7 +127,6 @@ and 'loc exports = mutable kind: 'loc module_kind; mutable types: 'loc export_type smap; mutable type_stars: ('loc loc_node * module_ref_node) list; - mutable global_types: 'loc binding_node SMap.t; strict: bool; platform_availability_set: Platform_set.t option; } @@ -424,7 +423,6 @@ module Exports = struct kind = UnknownModule; types = SMap.empty; type_stars = []; - global_types = SMap.empty; strict; platform_availability_set; } @@ -672,19 +670,12 @@ module Scope = struct (match lookup_scope name values types with | Some binding -> Some (binding, scope) | None -> lookup_type parent name) - | Module { values; types; exports = Exports { global_types; _ }; _ } -> - Base.Option.map - ~f:(fun binding -> (binding, scope)) - (match lookup_scope name values types with - | Some result -> Some result - | None -> lookup_scope name SMap.empty global_types) - | DeclareModule { parent; values; types; exports = Exports { global_types; _ }; _ } -> + | Module { values; types; _ } -> + Base.Option.map ~f:(fun binding -> (binding, scope)) (lookup_scope name values types) + | DeclareModule { parent; values; types; _ } -> (match lookup_scope name values types with | Some binding -> Some (binding, scope) - | None -> - (match lookup_scope name SMap.empty global_types with - | Some binding -> Some (binding, scope) - | None -> lookup_type parent name)) + | None -> lookup_type parent name) let rec find_host scope b = match scope with diff --git a/src/services/inference/check_service.ml b/src/services/inference/check_service.ml index 3b5eaeaff74..f4dd678e47f 100644 --- a/src/services/inference/check_service.ml +++ b/src/services/inference/check_service.ml @@ -173,31 +173,9 @@ let mk_check_file ~reader ~options ~master_cx ~cache () = |> Merge.merge_export (Lazy.force file_rec) ) in - let global_types_map = - let local n index = - lazy - (let { Merge.local_defs; cx; _ } = Lazy.force file_rec in - let global_builtins = Context.global_builtins cx in - let (loc, _, (lazy t), _) = Local_defs.get local_defs index |> Lazy.force in - (match Builtins.get_builtin_type_opt global_builtins n with - | Some (def_loc, _) -> ConsGen.error_on_bad_global_shadow cx n ~loc ~def_loc - | None -> ()); - (loc, t) - ) - in - let f acc name i = SMap.add name (local name i) acc in - Base.Array.fold2_exn ~init:SMap.empty ~f - in let cjs_module buf pos = - let (Pack.CJSModuleInfo - { - type_export_keys; - type_stars; - module_globals = Pack.ModuleGlobals { global_types; global_types_keys }; - strict; - platform_availability_set; - } - ) = + let (Pack.CJSModuleInfo { type_export_keys; type_stars; strict; platform_availability_set }) + = Bin.cjs_module_info buf pos |> Bin.read_hashed Bin.read_cjs_info buf |> Pack.map_cjs_module_info aloc @@ -208,9 +186,8 @@ let mk_check_file ~reader ~options ~master_cx ~cache () = let f acc name export = SMap.add name export acc in Base.Array.fold2_exn ~init:SMap.empty ~f type_export_keys type_exports in - let global_types = global_types_map global_types_keys global_types in Type_sig_merge.CJSExports - { type_exports; exports; type_stars; global_types; strict; platform_availability_set } + { type_exports; exports; type_stars; strict; platform_availability_set } in let es_module buf pos = let (Pack.ESModuleInfo @@ -219,7 +196,6 @@ let mk_check_file ~reader ~options ~master_cx ~cache () = export_keys; type_stars; stars; - module_globals = Pack.ModuleGlobals { global_types; global_types_keys }; strict; platform_availability_set; } @@ -238,17 +214,8 @@ let mk_check_file ~reader ~options ~master_cx ~cache () = let f acc name export = SMap.add name export acc in Base.Array.fold2_exn ~init:SMap.empty ~f export_keys exports in - let global_types = global_types_map global_types_keys global_types in Type_sig_merge.ESExports - { - type_exports; - exports; - type_stars; - stars; - global_types; - strict; - platform_availability_set; - } + { type_exports; exports; type_stars; stars; strict; platform_availability_set } in Type.Constraint.ForcingState.of_lazy_module ( reason, diff --git a/src/services/inference/merge_service.ml b/src/services/inference/merge_service.ml index e7bd7409eb8..6a654b6b5fc 100644 --- a/src/services/inference/merge_service.ml +++ b/src/services/inference/merge_service.ml @@ -73,13 +73,7 @@ let sig_hash ~check_dirty_set ~root = let filename = Fun.const (hash_file_key file_key) in let info_pos = Bin.cjs_module_info buf pos in let (P.CJSModuleInfo - { - type_export_keys; - type_stars = _; - module_globals = _; - strict = _; - platform_availability_set = _; - } + { type_export_keys; type_stars = _; strict = _; platform_availability_set = _ } ) = Bin.read_hashed Bin.read_cjs_info buf info_pos in @@ -101,7 +95,6 @@ let sig_hash ~check_dirty_set ~root = export_keys; type_stars = _; stars = _; - module_globals = _; strict = _; platform_availability_set = _; } @@ -164,13 +157,7 @@ let sig_hash ~check_dirty_set ~root = let info_pos = Bin.cjs_module_info buf pos in let init_hash = Bin.read_hashed Bin.hash_serialized buf info_pos in let (P.CJSModuleInfo - { - type_export_keys; - type_stars; - module_globals = _; - strict = _; - platform_availability_set = _; - } + { type_export_keys; type_stars; strict = _; platform_availability_set = _ } ) = Bin.read_hashed Bin.read_cjs_info buf info_pos in @@ -203,7 +190,6 @@ let sig_hash ~check_dirty_set ~root = export_keys; type_stars; stars; - module_globals = _; strict = _; platform_availability_set = _; } diff --git a/src/typing/context.ml b/src/typing/context.ml index 920858087f7..894f212f332 100644 --- a/src/typing/context.ml +++ b/src/typing/context.ml @@ -242,7 +242,6 @@ type t = { mutable refined_locations: ALocSet.t ALocMap.t; mutable aggressively_invalidated_locations: Refinement_invalidation.t ALocMap.t; node_cache: Node_cache.t; - mutable local_builtins: Builtins.t Lazy.t option; } and resolve_require = string -> resolved_require @@ -434,7 +433,6 @@ let make ccx metadata file aloc_table resolve_require mk_builtins = node_cache = Node_cache.mk_empty (); refined_locations = ALocMap.empty; aggressively_invalidated_locations = ALocMap.empty; - local_builtins = None; } in ccx.builtins <- lazy (mk_builtins cx); @@ -460,13 +458,7 @@ let global_builtins cx = Lazy.force cx.ccx.builtins let builtin_value_opt cx = Builtins.get_builtin_value_opt (global_builtins cx) -let builtin_type_opt cx n = - match cx.local_builtins with - | Some (lazy b) -> - (match Builtins.get_builtin_type_opt b n with - | Some v -> Some v - | None -> Builtins.get_builtin_type_opt (global_builtins cx) n) - | None -> Builtins.get_builtin_type_opt (global_builtins cx) n +let builtin_type_opt cx n = Builtins.get_builtin_type_opt (global_builtins cx) n let builtin_module_opt cx = Builtins.get_builtin_module_opt (global_builtins cx) @@ -789,8 +781,6 @@ let add_inferred_component_return cx loc t = in cx.ccx.inferred_component_return <- ALocFuzzyMap.add loc bounds inferred_component_return -let extend_local_builtins cx local_builtins = cx.local_builtins <- Some local_builtins - let set_evaluated cx evaluated = cx.ccx.sig_cx <- { cx.ccx.sig_cx with evaluated } let set_graph cx graph = cx.ccx.sig_cx <- { cx.ccx.sig_cx with graph } diff --git a/src/typing/context.mli b/src/typing/context.mli index 2ca9067b9b5..09354c47e8b 100644 --- a/src/typing/context.mli +++ b/src/typing/context.mli @@ -391,8 +391,6 @@ val add_refined_location : t -> ALoc.t -> ALocSet.t -> unit val add_aggressively_invalidated_location : t -> ALoc.t -> Refinement_invalidation.t -> unit -val extend_local_builtins : t -> Builtins.t Lazy.t -> unit - val set_evaluated : t -> Type.t Type.Eval.Map.t -> unit val set_graph : t -> Type.Constraint.graph -> unit diff --git a/src/typing/flow_js_utils.ml b/src/typing/flow_js_utils.ml index 366b1fcb693..d363d7b6733 100644 --- a/src/typing/flow_js_utils.ml +++ b/src/typing/flow_js_utils.ml @@ -1505,7 +1505,6 @@ module CJSRequireTKit = struct let { module_reason; module_export_types = exports; - module_global_types_tmap = _; module_is_strict = imported_is_strict; module_available_platforms = _IGNORED_TODO; } = @@ -1592,7 +1591,6 @@ module ImportModuleNsTKit = struct let { module_reason; module_export_types = exports; - module_global_types_tmap = _; module_is_strict = imported_is_strict; module_available_platforms = _IGNORED_TODO; } = @@ -1653,7 +1651,6 @@ module ImportDefaultTKit = struct let { module_reason; module_export_types = exports; - module_global_types_tmap = _; module_is_strict = imported_is_strict; module_available_platforms = _IGNORED_TODO; } = @@ -1716,7 +1713,6 @@ module ImportNamedTKit = struct let { module_reason = _; module_export_types = exports; - module_global_types_tmap = _; module_is_strict = imported_is_strict; module_available_platforms = _IGNORED_TODO; } = @@ -1885,7 +1881,6 @@ module ExportNamedTKit = struct let { module_reason = _; module_export_types = { value_exports_tmap; type_exports_tmap; _ }; - module_global_types_tmap = _; module_is_strict = _; module_available_platforms = _; } = @@ -1939,7 +1934,6 @@ module CopyNamedExportsTKit = struct let { module_reason = _; module_export_types = source_exports; - module_global_types_tmap = _; module_is_strict = _; module_available_platforms = _; } = @@ -1981,7 +1975,6 @@ module CopyTypeExportsTKit = struct let { module_reason = _; module_export_types = source_exports; - module_global_types_tmap = _; module_is_strict = _; module_available_platforms = _; } = @@ -2056,7 +2049,6 @@ module CJSExtractNamedExportsTKit = struct let { module_reason; module_export_types = exporttypes; - module_global_types_tmap; module_is_strict; module_available_platforms; } = @@ -2065,7 +2057,6 @@ module CJSExtractNamedExportsTKit = struct { module_reason; module_export_types = { exporttypes with has_every_named_export = true }; - module_global_types_tmap; module_is_strict; module_available_platforms; } diff --git a/src/typing/merge_js.ml b/src/typing/merge_js.ml index b3a581975f6..d66545a6935 100644 --- a/src/typing/merge_js.ml +++ b/src/typing/merge_js.ml @@ -833,37 +833,18 @@ let copier = let copy_into dst_cx src_cx f () = let m = f () in match m with - | Ok ({ Type.module_export_types; module_global_types_tmap; _ } as m) -> + | Ok ({ Type.module_export_types; _ } as m) -> let (_ : Context.t) = copier#export_types src_cx Polarity.Positive dst_cx module_export_types in - let module_global_types_tmap = - SMap.map - (Lazy.map (fun (loc, t) -> - let (_ : Context.t) = copier#type_ src_cx Polarity.Positive dst_cx t in - (loc, t) - ) - ) - module_global_types_tmap - in - Ok { m with Type.module_global_types_tmap } + Ok m | Error _ -> m let copied dst_cx src_cx t = let (_ : Context.t) = copier#type_ src_cx Polarity.Positive dst_cx t in t -let module_type_copied dst_cx src_cx ({ Type.module_export_types; module_global_types_tmap; _ } as m) - = +let module_type_copied dst_cx src_cx ({ Type.module_export_types; _ } as m) = let (_ : Context.t) = copier#export_types src_cx Polarity.Positive dst_cx module_export_types in - let module_global_types_tmap = - SMap.map - (Lazy.map (fun (loc, t) -> - let (_ : Context.t) = copier#type_ src_cx Polarity.Positive dst_cx t in - (loc, t) - ) - ) - module_global_types_tmap - in - { m with Type.module_global_types_tmap } + m let merge_lib_files ~sig_opts ordered_asts = let (builtin_errors, builtin_locs, builtins) = diff --git a/src/typing/module_info_analyzer.ml b/src/typing/module_info_analyzer.ml index de758db0291..5e6807e6808 100644 --- a/src/typing/module_info_analyzer.ml +++ b/src/typing/module_info_analyzer.ml @@ -426,7 +426,6 @@ let mk_module_type = cjs_export = None; has_every_named_export = false; }; - module_global_types_tmap = SMap.empty; module_is_strict = Context.is_strict cx; module_available_platforms = Context.available_platforms cx; } @@ -482,7 +481,6 @@ let mk_module_type = { module_reason = reason_exports_module; module_export_types; - module_global_types_tmap = SMap.empty; module_is_strict = Context.is_strict cx; module_available_platforms = Context.available_platforms cx; } diff --git a/src/typing/type.ml b/src/typing/type.ml index dc9f318e5bc..58afa8347c7 100644 --- a/src/typing/type.ml +++ b/src/typing/type.ml @@ -1551,8 +1551,6 @@ module rec TypeTerm : sig and moduletype = { module_reason: reason; module_export_types: exporttypes; - module_global_types_tmap: (ALoc.t * t) lazy_t SMap.t; - (* global types from declare global {...} in a module. *) module_is_strict: bool; module_available_platforms: Platform_set.t option; } diff --git a/src/typing/type_sig_merge.ml b/src/typing/type_sig_merge.ml index 182ab02778d..ea9b583ce1b 100644 --- a/src/typing/type_sig_merge.ml +++ b/src/typing/type_sig_merge.ml @@ -24,7 +24,6 @@ type exports = type_exports: Type.named_symbol Lazy.t SMap.t; exports: Type.t Lazy.t option; type_stars: (ALoc.t * Module_refs.index) list; - global_types: (ALoc.t * Type.t) Lazy.t SMap.t; strict: bool; platform_availability_set: Platform_set.t option; } @@ -33,7 +32,6 @@ type exports = exports: Type.named_symbol Lazy.t SMap.t; type_stars: (ALoc.t * Module_refs.index) list; stars: (ALoc.t * Module_refs.index) list; - global_types: (ALoc.t * Type.t) Lazy.t SMap.t; strict: bool; platform_availability_set: Platform_set.t option; } @@ -382,8 +380,7 @@ let merge_type_export file reason = function let (lazy (loc, _name, type_)) = Remote_refs.get file.remote_refs index in { Type.name_loc = Some loc; preferred_def_locs = None; type_ } -let mk_commonjs_module_t - cx module_reason module_global_types_tmap module_is_strict module_available_platforms t = +let mk_commonjs_module_t cx module_reason module_is_strict module_available_platforms t = let open Type in let module_export_types = { @@ -394,13 +391,7 @@ let mk_commonjs_module_t } in let local_module = - { - module_reason; - module_export_types; - module_global_types_tmap; - module_is_strict; - module_available_platforms; - } + { module_reason; module_export_types; module_is_strict; module_available_platforms } in ConsGen.lazy_cjs_extract_named_exports cx module_reason local_module t @@ -415,8 +406,7 @@ let merge_exports = in (loc, f) in - let mk_es_module_t - file module_reason module_global_types_tmap module_is_strict module_available_platforms = + let mk_es_module_t file module_reason module_is_strict module_available_platforms = let open Type in let module_export_types = { @@ -426,13 +416,7 @@ let merge_exports = has_every_named_export = false; } in - { - module_reason; - module_export_types; - module_global_types_tmap; - module_is_strict; - module_available_platforms; - } + { module_reason; module_export_types; module_is_strict; module_available_platforms } in let copy_named_exports file target_module_type (_, from_ns) = @@ -464,8 +448,7 @@ let merge_exports = (fun file reason stars acc -> loop file reason acc stars) in fun file reason -> function - | CJSExports - { type_exports; exports; type_stars; global_types; strict; platform_availability_set } -> + | CJSExports { type_exports; exports; type_stars; strict; platform_availability_set } -> let exports = match exports with | Some (lazy t) -> t @@ -477,14 +460,7 @@ let merge_exports = lazy (let module_type = Lazy.force - (mk_commonjs_module_t - file.cx - reason - global_types - strict - platform_availability_set - exports - ) + (mk_commonjs_module_t file.cx reason strict platform_availability_set exports) in Flow_js_utils.ExportNamedTKit.mod_ModuleT file.cx @@ -495,25 +471,14 @@ let merge_exports = ) in lazy_module - | ESExports - { - type_exports; - exports; - stars; - type_stars; - global_types; - strict; - platform_availability_set; - } -> + | ESExports { type_exports; exports; stars; type_stars; strict; platform_availability_set } -> let exports = SMap.map Lazy.force exports |> NameUtils.namemap_of_smap in let type_exports = SMap.map Lazy.force type_exports |> NameUtils.namemap_of_smap in let stars = List.map (merge_star file) stars in let type_stars = List.map (merge_star file) type_stars in let lazy_module = lazy - (let module_type = - mk_es_module_t file reason global_types strict platform_availability_set - in + (let module_type = mk_es_module_t file reason strict platform_availability_set in Flow_js_utils.ExportNamedTKit.mod_ModuleT file.cx (exports, type_exports, Type.DirectExport) @@ -2108,7 +2073,7 @@ let merge_resource_module_t cx file_key filename = in let file_loc = ALoc.of_loc { Loc.none with Loc.source = Some file_key } in let reason = Reason.(mk_reason RExports file_loc) in - (reason, mk_commonjs_module_t cx reason SMap.empty (Context.is_strict cx) None exports_t) + (reason, mk_commonjs_module_t cx reason (Context.is_strict cx) None exports_t) let merge tps = merge (mk_merge_env tps) @@ -2219,37 +2184,8 @@ let merge_builtins |> merge_export (Lazy.force file_and_dependency_map_rec |> fst) ) in - let global_types_map = - let local n index = - lazy - (let ({ local_defs; _ }, _) = Lazy.force file_and_dependency_map_rec in - let (loc, _, (lazy t), _) = Local_defs.get local_defs index |> Lazy.force in - let error_on_bad_global_shadow global_i = - let (def_loc, _, _, _) = Local_defs.get local_defs global_i |> Lazy.force in - ConsGen.error_on_bad_global_shadow cx n ~loc ~def_loc - in - (match SMap.find_opt n global_values with - | Some global_i -> error_on_bad_global_shadow global_i - | None -> - (match SMap.find_opt n global_types with - | Some global_i -> error_on_bad_global_shadow global_i - | None -> ())); - (loc, t) - ) - in - let f acc name i = SMap.add name (local name i) acc in - Base.Array.fold2_exn ~init:SMap.empty ~f - in let cjs_module type_exports exports info = - let (Pack.CJSModuleInfo - { - type_export_keys; - type_stars; - module_globals = Pack.ModuleGlobals { global_types; global_types_keys }; - strict; - platform_availability_set; - } - ) = + let (Pack.CJSModuleInfo { type_export_keys; type_stars; strict; platform_availability_set }) = Pack.map_cjs_module_info aloc info in let type_exports = Array.map type_export type_exports in @@ -2258,21 +2194,11 @@ let merge_builtins let f acc name export = SMap.add name export acc in Base.Array.fold2_exn ~init:SMap.empty ~f type_export_keys type_exports in - let global_types = global_types_map global_types_keys global_types in - CJSExports - { type_exports; exports; type_stars; global_types; strict; platform_availability_set } + CJSExports { type_exports; exports; type_stars; strict; platform_availability_set } in let es_module type_exports exports info = let (Pack.ESModuleInfo - { - type_export_keys; - export_keys; - type_stars; - stars; - module_globals = Pack.ModuleGlobals { global_types; global_types_keys }; - strict; - platform_availability_set; - } + { type_export_keys; export_keys; type_stars; stars; strict; platform_availability_set } ) = Pack.map_es_module_info aloc info in @@ -2286,17 +2212,7 @@ let merge_builtins let f acc name export = SMap.add name export acc in Base.Array.fold2_exn ~init:SMap.empty ~f export_keys exports in - let global_types = global_types_map global_types_keys global_types in - ESExports - { - type_exports; - exports; - type_stars; - stars; - global_types; - strict; - platform_availability_set; - } + ESExports { type_exports; exports; type_stars; stars; strict; platform_availability_set } in lazy (let info = diff --git a/src/typing/type_sig_merge.mli b/src/typing/type_sig_merge.mli index d28c31460b9..9b5bb7a7438 100644 --- a/src/typing/type_sig_merge.mli +++ b/src/typing/type_sig_merge.mli @@ -13,7 +13,6 @@ type exports = type_exports: Type.named_symbol Lazy.t SMap.t; exports: Type.t Lazy.t option; type_stars: (ALoc.t * Module_refs.index) list; - global_types: (ALoc.t * Type.t) Lazy.t SMap.t; strict: bool; platform_availability_set: Platform_set.t option; } @@ -22,7 +21,6 @@ type exports = exports: Type.named_symbol Lazy.t SMap.t; type_stars: (ALoc.t * Module_refs.index) list; stars: (ALoc.t * Module_refs.index) list; - global_types: (ALoc.t * Type.t) Lazy.t SMap.t; strict: bool; platform_availability_set: Platform_set.t option; }