Distinguish between opaque and transparent type aliases in the runtime
commit9a8fed298ca361335f1d5e3bae83702dc47a3b8d
authorOguz Ulgen <oulgen@fb.com>
Sat, 22 Jun 2019 03:33:03 +0000 (21 20:33 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Sat, 22 Jun 2019 03:37:10 +0000 (21 20:37 -0700)
tree5dedffe3d3345f633f2e3b1cdee3af967ab2165c
parent9a0ed802e674c1db19f4319351769b979e96c32c
Distinguish between opaque and transparent type aliases in the runtime

Summary: This diff adds an opaque field to the runtime representation of type aliases created through `newtype` declaration. Presence of this new field prevents `int` and `T` being equal where `newtype T =  int`.

Reviewed By: vassilmladenov

Differential Revision: D15902214

fbshipit-source-id: 31e52731189af7cecfe2d12d88e49370b2460af6
hphp/hack/src/hhbc/emit_type_constant.ml
hphp/hack/src/hhbc/emit_typedef.ml
hphp/test/slow/dv_array/type-structure.php.expect
hphp/test/slow/dv_array_hack_arr/type-structure.php.expect
hphp/test/slow/reified_generics/opaque-type-alias-1.php [new file with mode: 0644]
hphp/test/slow/reified_generics/opaque-type-alias-1.php.expect [new file with mode: 0644]
hphp/test/slow/type_annotation/type_annotation_expand_typedef1.php.expect