Make namespacing behavior more consistent
commit89199064f147bc836c4b6e9d032dd6943da3a6be
authorJake Bailey (Hacklang) <jakebailey@fb.com>
Wed, 6 May 2020 03:45:07 +0000 (5 20:45 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 6 May 2020 03:59:49 +0000 (5 20:59 -0700)
treeb6b1dff4df19a6ac5f4aaf62c5a7e15933e4ab68
parentfab51a644592b6e00254bdb3e3281708b28c0b3e
Make namespacing behavior more consistent

Summary:
Prefix names in the global namespace with a backslash, as the OCaml decl parser does.

If we guarantee a trailing backslash on the current namespace name in the direct decl parser's NamespaceBuilder, it's a bit easier to qualify a name in the current namespace. We need only concatenate it to the current namespace (rather than checking to see if it ends in a backslash).

Reviewed By: Wilfred

Differential Revision: D21147055

fbshipit-source-id: d051720b62f6c3ffd23956411fffbb209de9aeec
48 files changed:
hphp/hack/src/decl/direct_decl_smart_constructors.rs
hphp/hack/src/hh_check.rs
hphp/hack/src/hh_single_decl.ml
hphp/hack/test/decl/abstract_method.php.exp
hphp/hack/test/decl/array_typehints.php.exp
hphp/hack/test/decl/async_and_generator_functions.php.exp
hphp/hack/test/decl/at_most_rx_as_func.php.exp
hphp/hack/test/decl/class_const_int_literals.php.exp
hphp/hack/test/decl/class_in_namespace.php.exp
hphp/hack/test/decl/classes.php.exp
hphp/hack/test/decl/classes_consistent_construct.php.exp
hphp/hack/test/decl/classes_const_attribute.php.exp
hphp/hack/test/decl/classes_const_keyword.php.exp
hphp/hack/test/decl/classes_inferred_constant_types.php.exp
hphp/hack/test/decl/classes_inheritance.php.exp
hphp/hack/test/decl/classes_reified_generics.php.exp
hphp/hack/test/decl/classes_require.php.exp
hphp/hack/test/decl/classes_typeconst.php.exp
hphp/hack/test/decl/constants.php.exp
hphp/hack/test/decl/deprecated.php.exp
hphp/hack/test/decl/enforceable_type_const.php.exp
hphp/hack/test/decl/enums.php.exp
hphp/hack/test/decl/file_mode.php.exp
hphp/hack/test/decl/final_method.php.exp
hphp/hack/test/decl/functions.php.exp
hphp/hack/test/decl/generic_classes.php.exp
hphp/hack/test/decl/interface.php.exp
hphp/hack/test/decl/interfaces.php.exp
hphp/hack/test/decl/like_types.php.exp
hphp/hack/test/decl/memoize_lsb.php.exp
hphp/hack/test/decl/missing_function_typehints.php.exp
hphp/hack/test/decl/multiple_user_attributes_on_class.php.exp
hphp/hack/test/decl/namespace_elaboration.php.exp
hphp/hack/test/decl/namespaces1.php.exp
hphp/hack/test/decl/namespaces2.php.exp
hphp/hack/test/decl/nested_namespaces.php.exp
hphp/hack/test/decl/nullable_xhp_typehint.php.exp
hphp/hack/test/decl/only_rx_if_impl_method.php.exp
hphp/hack/test/decl/override_attribute.php.exp
hphp/hack/test/decl/partially_abstract_type_const.php.exp
hphp/hack/test/decl/property_declarations.php.exp
hphp/hack/test/decl/qualified_name_in_attribute_arg.php.exp
hphp/hack/test/decl/self_in_type_constant.php.exp
hphp/hack/test/decl/shapes.php.exp
hphp/hack/test/decl/soft_type_hint.php.exp
hphp/hack/test/decl/traits.php.exp
hphp/hack/test/decl/tuples.php.exp
hphp/hack/test/decl/typedefs.php.exp