Write Rust library for deserializing via typechecker
commit97418e687dab553222b34e417cc065bf8243d917
authorLeo Osvald <leoo@fb.com>
Tue, 4 Jan 2022 21:43:21 +0000 (4 13:43 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 4 Jan 2022 21:44:49 +0000 (4 13:44 -0800)
tree7377987335da4360b417a5773cc0b80adeaf6bbd
parentce65616c677c702d7a122a3803e4805f9f6438c2
Write Rust library for deserializing via typechecker

Summary:
In light of experimentation around computing type info in native code,
write a Rust library to deserialize a stream of newline-separated JSON objects
that represent types in a typed AST of each program. Such serialized type info
is readily available, albeit potentially slow to compute via:

  hh_single_type_check --type PATH_TO_HACK_FILE

Write "roundtrip" unit tests via type-safe by construction JSON literals,
which validate that the we get back that original and final JSON match:

    (original) JSON (-> String) -> Ty<'_> -> String -> JSON (final)
                                   ^^^^^^^^^^^^^^^^
                                   deserialization

Reviewed By: shayne-fletcher

Differential Revision: D33288197

fbshipit-source-id: 9539cb62535ec3d6608ef6ead9bc95fc3c9a8529
hphp/hack/src/typing/serialization/de.rs [new file with mode: 0644]