Support ~ types on XHP attributes that are enum {'x', 'y'}
commitf14308e07cc39df307d6576f57fcf80db611a9f8
authorVassil Mladenov <vmladenov@fb.com>
Wed, 19 Jan 2022 19:52:28 +0000 (19 11:52 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 19 Jan 2022 19:54:06 +0000 (19 11:54 -0800)
tree419a080ae73db3e413012220e0fa14b05715e0e4
parente750a77c189168e5cef5c10277c24e9bad7eeed8
Support ~ types on XHP attributes that are enum {'x', 'y'}

Summary: Suggestion from D33344425, allows for ~ syntax on XHP enum attribute types. This is a special type that is only allowed in XHP declarations. This syntax is gated by the `like_type_hints` flag.

Reviewed By: andrewjkennedy

Differential Revision: D33358970

fbshipit-source-id: 169822c061e67e514516b09bb125c32867be7bda
41 files changed:
hphp/hack/src/annotated_ast/aast.ml
hphp/hack/src/decl/direct_decl_smart_constructors.rs
hphp/hack/src/decl/direct_decl_smart_constructors_generated.rs
hphp/hack/src/facts/facts_smart_constructors_generated.rs
hphp/hack/src/hackfmt/hack_format.ml
hphp/hack/src/naming/naming.ml
hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs
hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs
hphp/hack/src/oxidized/gen/aast.rs
hphp/hack/src/oxidized_by_ref/gen/aast.rs
hphp/hack/src/parser/core/declaration_parser.rs
hphp/hack/src/parser/decl_mode_smart_constructors_generated.rs
hphp/hack/src/parser/flatten_smart_constructors.rs
hphp/hack/src/parser/full_fidelity_syntax.ml
hphp/hack/src/parser/full_fidelity_syntax_type.ml
hphp/hack/src/parser/full_fidelity_validated_syntax.ml
hphp/hack/src/parser/js/full_fidelity_schema.json
hphp/hack/src/parser/lowerer/lowerer.rs
hphp/hack/src/parser/pair_smart_constructors_generated.rs
hphp/hack/src/parser/positioned_smart_constructors.rs
hphp/hack/src/parser/schema/full_fidelity_schema.ml
hphp/hack/src/parser/schema/full_fidelity_schema_version_number.rs
hphp/hack/src/parser/schema/schema_definition.ml
hphp/hack/src/parser/smart_constructors_generated.rs
hphp/hack/src/parser/smart_constructors_wrappers.rs
hphp/hack/src/parser/syntax_by_ref/syntax_children_iterator_generated.rs
hphp/hack/src/parser/syntax_by_ref/syntax_serialize_generated.rs
hphp/hack/src/parser/syntax_by_ref/syntax_type_impl_generated.rs
hphp/hack/src/parser/syntax_by_ref/syntax_variant_generated.rs
hphp/hack/src/parser/syntax_generated.rs
hphp/hack/src/parser/syntax_sig.ml
hphp/hack/src/parser/syntax_smart_constructors_generated.rs
hphp/hack/src/parser/syntax_type.rs
hphp/hack/src/parser/verify_smart_constructors_generated.rs
hphp/hack/test/holes/xhp_simple_attribute.php.holes.exp
hphp/hack/test/holes/xhp_spread_attribute.php.holes.exp
hphp/hack/test/sound_dynamic/typing/xhp_enum_attr_like.good.php [new file with mode: 0644]
hphp/hack/test/sound_dynamic/typing/xhp_enum_attr_like.good.php.exp [new file with mode: 0644]
hphp/hack/test/tast/xhp.php.exp
hphp/test/slow/xhp/enum_like.php [new file with mode: 0644]
hphp/test/slow/xhp/enum_like.php.expectf [new file with mode: 0644]