Moving from class wrapper to class-less wrapper
commit7567e0e3ede0b24da4da1a590cd0aec56e1c76e6
authorVincent Siles <vsiles@fb.com>
Fri, 8 Jan 2021 10:52:04 +0000 (8 02:52 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 8 Jan 2021 10:53:50 +0000 (8 02:53 -0800)
treeb8c426abdc508bfb792138d7cdeec9144c0fb46d
parentdd3043873c5b5441e860b2fccfc73eccabd9af02
Moving from class wrapper to class-less wrapper

Summary:
moving from using the EnumMember class wrapper by default to use the type
alias MemberOf wrapper instead.

Main changes:
- changing `EnumMember` to `MemberOf` (final syntax to be determined)
- in test files: removal of `->data()`
- parser update `Name<Type>(Expr)` into `Type Name = Expr`
- naming: we allow any expression as initial value for a enum class constant as long as it is correctly typed
- typing: see inlined comments: fiddling a bit with the wrapper when typechecking the body of an enum class
- declared MemberOf in HHVM php files.

Reviewed By: shayne-fletcher

Differential Revision: D25758179

fbshipit-source-id: a7ea5fff81246edf3ca8a1c4d02282318ccc9757
116 files changed:
hphp/hack/hhi/BuiltinEnum.hhi
hphp/hack/src/decl/decl_enum.ml
hphp/hack/src/decl/decl_enum.mli
hphp/hack/src/decl/direct_decl_smart_constructors.rs
hphp/hack/src/decl/direct_decl_smart_constructors_generated.rs
hphp/hack/src/errors/errors.ml
hphp/hack/src/facts/facts_smart_constructors_generated.rs
hphp/hack/src/hackfmt/hack_format.ml
hphp/hack/src/hhbc/emit_body.rs
hphp/hack/src/naming/naming.ml
hphp/hack/src/naming/naming_special_names.ml
hphp/hack/src/naming/naming_special_names.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/minimal_smart_constructors.rs
hphp/hack/src/parser/ocaml_syntax_generated.rs
hphp/hack/src/parser/positioned_smart_constructors.rs
hphp/hack/src/parser/schema/full_fidelity_schema.ml
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_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/src/typing/typing.ml
hphp/hack/src/typing/typing_check_decls.ml
hphp/hack/src/typing/typing_toplevel.ml
hphp/hack/src/utils/lsp/lsp.ml
hphp/hack/src/utils/lsp/lsp.mli
hphp/hack/test/decl/atom.php
hphp/hack/test/decl/atom.php.exp
hphp/hack/test/decl/atom.php.typecheck.exp
hphp/hack/test/enum_atom/compilation/test.php
hphp/hack/test/enum_atom/compilation/test.php.exp
hphp/hack/test/enum_atom/typing/atom.php
hphp/hack/test/enum_atom/typing/atom.php.exp
hphp/hack/test/enum_atom/typing/atom1.php
hphp/hack/test/enum_atom/typing/atom2.php
hphp/hack/test/enum_atom/typing/atom2.php.exp
hphp/hack/test/enum_atom/typing/atom3.php
hphp/hack/test/enum_atom/typing/atom3.php.exp
hphp/hack/test/enum_atom/typing/atom_generic_validation.php
hphp/hack/test/enum_atom/typing/atom_generic_validation.php.exp
hphp/hack/test/enum_atom/typing/atom_wrong_type.php.exp
hphp/hack/test/enum_class/parsing/enum_class_definition.good.php
hphp/hack/test/enum_class/parsing/enum_class_definition.good.php.exp
hphp/hack/test/enum_class/parsing/enum_class_definition0.bad.php
hphp/hack/test/enum_class/parsing/enum_class_definition0.bad.php.exp
hphp/hack/test/enum_class/parsing/enum_class_definition1.bad.php
hphp/hack/test/enum_class/parsing/enum_class_definition1.bad.php.exp
hphp/hack/test/enum_class/parsing/enum_class_definition2.bad.php.exp
hphp/hack/test/enum_class/parsing/enum_class_definition3.bad.php
hphp/hack/test/enum_class/parsing/enum_class_definition3.bad.php.exp
hphp/hack/test/enum_class/parsing/enum_class_definition4.bad.php
hphp/hack/test/enum_class/parsing/enum_class_definition4.bad.php.exp
hphp/hack/test/enum_class/parsing/enum_class_extension.good.php
hphp/hack/test/enum_class/parsing/enum_class_extension.good.php.exp
hphp/hack/test/enum_class/parsing/enum_class_extension0.bad.php
hphp/hack/test/enum_class/parsing/enum_class_extension0.bad.php.exp
hphp/hack/test/enum_class/typing/typing.extends.good.php
hphp/hack/test/enum_class/typing/typing.extends0.bad.php
hphp/hack/test/enum_class/typing/typing.extends0.bad.php.exp
hphp/hack/test/enum_class/typing/typing.extends1.bad.php
hphp/hack/test/enum_class/typing/typing.extends1.bad.php.exp
hphp/hack/test/enum_class/typing/typing.extends3.bad.php
hphp/hack/test/enum_class/typing/typing.extends4.bad.php
hphp/hack/test/enum_class/typing/typing.extends5.bad.php
hphp/hack/test/enum_class/typing/typing.extends5.bad.php.exp
hphp/hack/test/enum_class/typing/typing.extends5.bad.php.legacy_decl.exp
hphp/hack/test/enum_class/typing/typing.extends6.bad.php
hphp/hack/test/enum_class/typing/typing.good.php
hphp/hack/test/enum_class/typing/typing.multiple.extends.diamond.bad.php
hphp/hack/test/enum_class/typing/typing.multiple.extends.vshape.bad.php
hphp/hack/test/enum_class/typing/typing.multiple.extends.vshape.bad.php.exp
hphp/hack/test/enum_class/typing/typing.multiple.extends.vshape.good.php
hphp/hack/test/enum_class/typing/typing0.bad.php [copied from hphp/hack/test/enum_class/typing/typing1.bad.php with 73% similarity]
hphp/hack/test/enum_class/typing/typing0.bad.php.exp
hphp/hack/test/enum_class/typing/typing1.bad.php
hphp/hack/test/enum_class/typing/typing1.bad.php.exp
hphp/hack/test/enum_class/typing/typing2.bad.php
hphp/hack/test/enum_class/typing/typing3.bad.php
hphp/hack/test/enum_class/typing/typing3.bad.php.exp
hphp/hack/test/enum_class/typing/typing4.bad.php
hphp/hack/test/enum_class/typing/typing4.bad.php.exp
hphp/hack/test/enum_class/typing/typing5.bad.php
hphp/hack/test/enum_class/typing/typing5.bad.php.exp
hphp/hack/test/enum_class/typing/typing6.bad.php
hphp/hack/test/enum_class/typing/typing6.bad.php.exp
hphp/hack/test/unit/server_tests.ml
hphp/system/php.txt
hphp/system/php/member_of.ns.php [new file with mode: 0644]
hphp/test/slow/enum_class/enum_class09.php
hphp/test/slow/enum_class/enum_class09.php.expectf
hphp/test/slow/enum_class/enum_class10.php [copied from hphp/test/slow/enum_class/enum_class14.php with 70% similarity]
hphp/test/slow/enum_class/enum_class11.php
hphp/test/slow/enum_class/enum_class12.php
hphp/test/slow/enum_class/enum_class13.php
hphp/test/slow/enum_class/enum_class13.php.expectf
hphp/test/slow/enum_class/enum_class14.php
hphp/test/slow/enum_class/enum_class14.php.expectf
hphp/test/slow/enum_class/enum_class15.php [copied from hphp/test/slow/enum_class/enum_class14.php with 70% similarity]
hphp/test/slow/enum_class/enum_class15.php.expectf
hphp/test/slow/enum_class/enum_class16.php
hphp/test/slow/enum_class/enum_class17.php
hphp/test/slow/enum_class/enum_class18.php