handle namespacing of primitives
commit82b8e25357f999ff1883b26f91ebd819de2ee1d5
authorMax Heiber <mheiber@fb.com>
Tue, 16 Aug 2022 11:10:53 +0000 (16 04:10 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 16 Aug 2022 11:10:53 +0000 (16 04:10 -0700)
tree77830b0817327b2d09522483a2d577e9beda44b8
parente94f139f255c5b8d3fcf415aa5db2eb6ee612a84
handle namespacing of primitives

Summary:
Bless a list of primitives so readonly checks pass in Hackc.

Just like in `parser/readonly_check.rs`, used in prod, we allow returning a value as some_primitive_type as mutable even when the value is readonly. Easiest to explain via the snapshot test: `primitives_namespacing.php` in D38462806.

## Why:

The readonly checking in `parser/readonly_check.rs` expects primitives to look like this: `int`.

But in hackc, we are seeing types after `elaborate_namespace_visitor`, which changes `int` to `\HH\int`.

Reviewed By: aorenste

Differential Revision: D38579242

fbshipit-source-id: 491c53de71e8849301497b88027bfff115f09b37
hphp/hack/Cargo.lock
hphp/hack/src/hackc/types/cargo/types/Cargo.toml
hphp/hack/src/hackc/types/readonly_check.rs
hphp/hack/src/naming/naming_special_names.rs
hphp/hack/src/parser/readonly_check.rs