diff --git a/codegen/inferred_relationships.hack b/codegen/inferred_relationships.hack index 1be8b7c3..bdce6b69 100644 --- a/codegen/inferred_relationships.hack +++ b/codegen/inferred_relationships.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<0cb6442b34479c8ca9d81ac0cc1ec48a>> + * @generated SignedSource<<98d1343319d373e70b496b591b86712a>> */ namespace Facebook\HHAST\__Private; @@ -11,8 +11,8 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'old_attribute_specification', ], 'alias_declaration.alias_constraint' => keyset[ + 'list', 'missing', - 'type_constraint', ], 'alias_declaration.alias_equal' => keyset[ 'token:=', @@ -26,12 +26,10 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'token:type', ], 'alias_declaration.alias_modifiers' => keyset[ - 'list', 'missing', ], 'alias_declaration.alias_module_kw_opt' => keyset[ 'missing', - 'token:module', ], 'alias_declaration.alias_name' => keyset[ 'token:name', @@ -148,6 +146,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'darray_type_specifier', 'dictionary_type_specifier', 'generic_type_specifier', + 'like_type_specifier', 'nullable_type_specifier', 'simple_type_specifier', 'tuple_type_specifier', @@ -450,8 +449,6 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list', 'list', 'list', - 'list', - 'list', 'missing', ], 'classish_declaration.classish_name' => keyset[ @@ -487,6 +484,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'missing', 'simple_type_specifier', 'type_constant', + 'type_refinement', ], 'closure_parameter_type_specifier.closure_parameter_call_convention' => keyset[ @@ -500,6 +498,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'attributized_specifier', 'closure_type_specifier', 'darray_type_specifier', + 'dictionary_type_specifier', 'generic_type_specifier', 'nullable_type_specifier', 'simple_type_specifier', @@ -548,6 +547,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'like_type_specifier', 'nullable_type_specifier', 'simple_type_specifier', + 'type_refinement', 'vector_type_specifier', ], 'collection_literal_expression.collection_literal_initializers' => keyset[ @@ -922,6 +922,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list>', 'list|list_item>', 'list>', + 'list|list_item>', 'list>', 'list|list_item>', 'list|list_item>', @@ -1170,6 +1171,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list|list_item>', 'list>', 'list|list_item>', + 'list|list_item>', 'list|list_item>', 'list|list_item>', ], @@ -1355,8 +1357,6 @@ const dict> INFERRED_RELATIONSHIPS = dict[ ], 'enum_class_declaration.enum_class_modifiers' => keyset[ 'list', - 'list', - 'list', 'missing', ], 'enum_class_declaration.enum_class_name' => keyset[ @@ -1412,7 +1412,6 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'token:{', ], 'enum_declaration.enum_modifiers' => keyset[ - 'list', 'missing', ], 'enum_declaration.enum_name' => keyset[ @@ -2141,8 +2140,6 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list', 'list', 'list', - 'list', - 'list', 'list', 'list', 'list', @@ -2186,6 +2183,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'token:noreturn', 'tuple_type_specifier', 'type_constant', + 'type_refinement', 'varray_type_specifier', 'vector_type_specifier', ], @@ -2535,7 +2533,9 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'tuple_expression', 'tuple_type_specifier', 'type_constant', + 'type_in_refinement', 'type_parameter', + 'type_refinement', 'variable', 'variadic_parameter', 'varray_intrinsic_expression', @@ -2601,7 +2601,6 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'token:;', ], 'module_declaration.module_declaration_attribute_spec' => keyset[ - 'missing', 'old_attribute_specification', ], 'module_declaration.module_declaration_exports' => keyset[ @@ -2828,6 +2827,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'simple_type_specifier', 'tuple_type_specifier', 'type_constant', + 'type_refinement', 'varray_type_specifier', 'vector_type_specifier', ], @@ -2934,8 +2934,6 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list>', ], 'property_declaration.property_modifiers' => keyset[ - 'list', - 'list', 'list', 'list', 'list', @@ -2981,6 +2979,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'token:require', ], 'require_clause.require_kind' => keyset[ + 'token:class', 'token:extends', 'token:implements', ], @@ -3071,10 +3070,9 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list', 'list', 'list', - 'list', 'list', 'list', - 'list', + 'list', 'list', 'list', 'list', @@ -3091,10 +3089,10 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list', 'list', 'list', + 'list', 'list', 'list', 'list', - 'list', 'list', 'list', 'list', @@ -3114,7 +3112,6 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list', 'list', 'list', - 'list', 'list', 'list', 'list', @@ -3122,8 +3119,6 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list', 'list', 'list', - 'list', - 'list', 'list', 'list', 'list', @@ -3477,6 +3472,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list|list_item>', 'list>', 'list|list_item>', + 'list|list_item>', 'list>', 'list|list_item>', 'list|list_item>', @@ -3489,9 +3485,11 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list>', 'list|list_item>', 'list|list_item>', + 'list|list_item>', 'list|list_item>', 'list>', 'list>', + 'list>', 'list>', 'list>', 'missing', @@ -3571,9 +3569,29 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'shape_type_specifier', 'simple_type_specifier', 'type_constant', + 'type_refinement', 'varray_type_specifier', 'vector_type_specifier', ], + 'type_in_refinement.type_in_refinement_constraints' => keyset[ + 'missing', + ], + 'type_in_refinement.type_in_refinement_equal' => keyset[ + 'token:=', + ], + 'type_in_refinement.type_in_refinement_keyword' => keyset[ + 'token:type', + ], + 'type_in_refinement.type_in_refinement_name' => keyset[ + 'token:name', + ], + 'type_in_refinement.type_in_refinement_type' => keyset[ + 'simple_type_specifier', + 'type_constant', + ], + 'type_in_refinement.type_in_refinement_type_parameters' => keyset[ + 'missing', + ], 'type_parameter.type_attribute_spec' => keyset[ 'missing', 'old_attribute_specification', @@ -3607,6 +3625,21 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'type_parameters.type_parameters_right_angle' => keyset[ 'token:>', ], + 'type_refinement.type_refinement_keyword' => keyset[ + 'token:with', + ], + 'type_refinement.type_refinement_left_brace' => keyset[ + 'token:{', + ], + 'type_refinement.type_refinement_members' => keyset[ + 'list>', + ], + 'type_refinement.type_refinement_right_brace' => keyset[ + 'token:}', + ], + 'type_refinement.type_refinement_type' => keyset[ + 'simple_type_specifier', + ], 'unset_statement.unset_keyword' => keyset[ 'token:unset', ], @@ -3851,6 +3884,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'list|list_item>', 'list>', 'list|list_item|list_item|list_item|list_item>', + 'list|list_item|list_item|list_item>', 'list|list_item|list_item|list_item>', 'list>', 'list>', @@ -3964,6 +3998,7 @@ const dict> INFERRED_RELATIONSHIPS = dict[ 'nullable_type_specifier', 'simple_type_specifier', 'type_constant', + 'type_refinement', 'vector_type_specifier', ], 'while_statement.while_body' => keyset[ diff --git a/codegen/node_from_json.hack b/codegen/node_from_json.hack index 069a55f3..f808102d 100644 --- a/codegen/node_from_json.hack +++ b/codegen/node_from_json.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<5cbc5ea10111cd0216a39c530f736a81>> + * @generated SignedSource<> */ namespace Facebook\HHAST\__Private; use namespace Facebook\HHAST; @@ -144,6 +144,9 @@ function node_from_json_unwrapped( 'nullable_type_specifier' => HHAST\NullableTypeSpecifier::class, 'object_creation_expression' => HHAST\ObjectCreationExpression::class, 'old_attribute_specification' => HHAST\OldAttributeSpecification::class, + 'package_declaration' => HHAST\PackageDeclaration::class, + 'package_includes' => HHAST\PackageIncludes::class, + 'package_uses' => HHAST\PackageUses::class, 'parameter_declaration' => HHAST\ParameterDeclaration::class, 'parenthesized_expression' => HHAST\ParenthesizedExpression::class, 'pipe_variable' => HHAST\PipeVariableExpression::class, diff --git a/codegen/schema.json b/codegen/schema.json index b7e77ceb..a67b19f3 100644 --- a/codegen/schema.json +++ b/codegen/schema.json @@ -1,6 +1,6 @@ { "description" : "@generated JSON schema of the Hack Full Fidelity Parser AST", - "version" : "2022-08-10-0000", + "version" : "2022-09-29-0000", "trivia" : [ { "trivia_kind_name" : "WhiteSpace", "trivia_type_name" : "whitespace" }, @@ -375,6 +375,8 @@ "token_text" : "readonly" }, { "token_kind" : "Internal", "token_text" : "internal" }, + { "token_kind" : "Package", + "token_text" : "package" }, { "token_kind" : "ErrorToken", "token_text" : null }, @@ -2141,6 +2143,39 @@ { "field_name" : "name" }, { "field_name" : "semicolon" } ] }, + { "kind_name" : "PackageDeclaration", + "type_name" : "package_declaration", + "description" : "package_declaration", + "prefix" : "package_declaration", + "fields" : [ + { "field_name" : "attribute_spec" }, + { "field_name" : "package_keyword" }, + { "field_name" : "name" }, + { "field_name" : "left_brace" }, + { "field_name" : "uses" }, + { "field_name" : "includes" }, + { "field_name" : "right_brace" } + ] }, + { "kind_name" : "PackageUses", + "type_name" : "package_uses", + "description" : "package_uses", + "prefix" : "package_uses", + "fields" : [ + { "field_name" : "use_keyword" }, + { "field_name" : "left_brace" }, + { "field_name" : "uses" }, + { "field_name" : "right_brace" } + ] }, + { "kind_name" : "PackageIncludes", + "type_name" : "package_includes", + "description" : "package_includes", + "prefix" : "package_includes", + "fields" : [ + { "field_name" : "include_keyword" }, + { "field_name" : "left_brace" }, + { "field_name" : "includes" }, + { "field_name" : "right_brace" } + ] }, { "kind_name" : "Token", "type_name" : "token", diff --git a/codegen/syntax/AliasDeclaration.hack b/codegen/syntax/AliasDeclaration.hack index e1e34ab4..41fd17ff 100644 --- a/codegen/syntax/AliasDeclaration.hack +++ b/codegen/syntax/AliasDeclaration.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<> + * @generated SignedSource<<27b32b5ffabaaeeac88bf08eea4ad05d>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -15,24 +15,24 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { const string SYNTAX_KIND = 'alias_declaration'; private ?OldAttributeSpecification $_attribute_spec; - private ?NodeList $_modifiers; - private ?ModuleToken $_module_kw_opt; + private ?Node $_modifiers; + private ?Node $_module_kw_opt; private Token $_keyword; private NameToken $_name; private ?TypeParameters $_generic_parameter; - private ?TypeConstraint $_constraint; + private ?NodeList $_constraint; private EqualToken $_equal; private ITypeSpecifier $_type; private SemicolonToken $_semicolon; public function __construct( ?OldAttributeSpecification $attribute_spec, - ?NodeList $modifiers, - ?ModuleToken $module_kw_opt, + ?Node $modifiers, + ?Node $module_kw_opt, Token $keyword, NameToken $name, ?TypeParameters $generic_parameter, - ?TypeConstraint $constraint, + ?NodeList $constraint, EqualToken $equal, ITypeSpecifier $type, SemicolonToken $semicolon, @@ -74,7 +74,7 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { $file, $offset, $source, - 'NodeList', + 'Node', ); $offset += $modifiers?->getWidth() ?? 0; $module_kw_opt = Node::fromJSON( @@ -82,7 +82,7 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { $file, $offset, $source, - 'ModuleToken', + 'Node', ); $offset += $module_kw_opt?->getWidth() ?? 0; $keyword = Node::fromJSON( @@ -117,7 +117,7 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { $file, $offset, $source, - 'TypeConstraint', + 'NodeList', ); $offset += $constraint?->getWidth() ?? 0; $equal = Node::fromJSON( @@ -227,12 +227,12 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { } return new static( $attribute_spec as ?OldAttributeSpecification, - /* HH_FIXME[4110] ?NodeList may not be enforceable */ $modifiers, - $module_kw_opt as ?ModuleToken, + $modifiers as ?Node, + $module_kw_opt as ?Node, $keyword as Token, $name as NameToken, $generic_parameter as ?TypeParameters, - $constraint as ?TypeConstraint, + /* HH_FIXME[4110] ?NodeList may not be enforceable */ $constraint, $equal as EqualToken, $type as ITypeSpecifier, $semicolon as SemicolonToken, @@ -283,7 +283,7 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { return $this->_modifiers; } - public function withModifiers(?NodeList $value): this { + public function withModifiers(?Node $value): this { if ($value === $this->_modifiers) { return $this; } @@ -306,16 +306,16 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { } /** - * @return NodeList | null + * @return null */ - public function getModifiers(): ?NodeList { + public function getModifiers(): ?Node { return $this->_modifiers; } /** - * @return NodeList + * @return */ - public function getModifiersx(): NodeList { + public function getModifiersx(): Node { return TypeAssert\not_null($this->getModifiers()); } @@ -323,7 +323,7 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { return $this->_module_kw_opt; } - public function withModuleKwOpt(?ModuleToken $value): this { + public function withModuleKwOpt(?Node $value): this { if ($value === $this->_module_kw_opt) { return $this; } @@ -346,16 +346,16 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { } /** - * @return null | ModuleToken + * @return null */ - public function getModuleKwOpt(): ?ModuleToken { + public function getModuleKwOpt(): ?Node { return $this->_module_kw_opt; } /** - * @return ModuleToken + * @return */ - public function getModuleKwOptx(): ModuleToken { + public function getModuleKwOptx(): Node { return TypeAssert\not_null($this->getModuleKwOpt()); } @@ -483,7 +483,7 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { return $this->_constraint; } - public function withConstraint(?TypeConstraint $value): this { + public function withConstraint(?NodeList $value): this { if ($value === $this->_constraint) { return $this; } @@ -506,16 +506,16 @@ final class AliasDeclaration extends Node implements IHasAttributeSpec { } /** - * @return null | TypeConstraint + * @return NodeList | null */ - public function getConstraint(): ?TypeConstraint { + public function getConstraint(): ?NodeList { return $this->_constraint; } /** - * @return TypeConstraint + * @return NodeList */ - public function getConstraintx(): TypeConstraint { + public function getConstraintx(): NodeList { return TypeAssert\not_null($this->getConstraint()); } diff --git a/codegen/syntax/AttributizedSpecifier.hack b/codegen/syntax/AttributizedSpecifier.hack index b17982bd..87a77433 100644 --- a/codegen/syntax/AttributizedSpecifier.hack +++ b/codegen/syntax/AttributizedSpecifier.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<0292b8b73ed163d95845503bd88c184a>> + * @generated SignedSource<<029c9c45acb4f6a4de09537c73291050>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -142,8 +142,8 @@ final class AttributizedSpecifier extends Node implements ITypeSpecifier { /** * @return ClosureTypeSpecifier | DarrayTypeSpecifier | - * DictionaryTypeSpecifier | GenericTypeSpecifier | NullableTypeSpecifier | - * SimpleTypeSpecifier | TupleTypeSpecifier + * DictionaryTypeSpecifier | GenericTypeSpecifier | LikeTypeSpecifier | + * NullableTypeSpecifier | SimpleTypeSpecifier | TupleTypeSpecifier */ public function getType(): ITypeSpecifier { return TypeAssert\instance_of(ITypeSpecifier::class, $this->_type); @@ -151,8 +151,8 @@ final class AttributizedSpecifier extends Node implements ITypeSpecifier { /** * @return ClosureTypeSpecifier | DarrayTypeSpecifier | - * DictionaryTypeSpecifier | GenericTypeSpecifier | NullableTypeSpecifier | - * SimpleTypeSpecifier | TupleTypeSpecifier + * DictionaryTypeSpecifier | GenericTypeSpecifier | LikeTypeSpecifier | + * NullableTypeSpecifier | SimpleTypeSpecifier | TupleTypeSpecifier */ public function getTypex(): ITypeSpecifier { return $this->getType(); diff --git a/codegen/syntax/ClassishDeclaration.hack b/codegen/syntax/ClassishDeclaration.hack index 5db579f4..c62c608d 100644 --- a/codegen/syntax/ClassishDeclaration.hack +++ b/codegen/syntax/ClassishDeclaration.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<> + * @generated SignedSource<<0b4b3a0c25254e05f99adb00d9e667f8>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -359,15 +359,14 @@ final class ClassishDeclaration /** * @return NodeList | NodeList | NodeList | - * NodeList | NodeList | null + * null */ public function getModifiers(): ?NodeList { return $this->_modifiers; } /** - * @return NodeList | NodeList | NodeList | - * NodeList | NodeList + * @return NodeList | NodeList | NodeList */ public function getModifiersx(): NodeList { return TypeAssert\not_null($this->getModifiers()); diff --git a/codegen/syntax/ClassnameTypeSpecifier.hack b/codegen/syntax/ClassnameTypeSpecifier.hack index 8661c69d..cbdc3005 100644 --- a/codegen/syntax/ClassnameTypeSpecifier.hack +++ b/codegen/syntax/ClassnameTypeSpecifier.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<940b4d1283c6d974b2cf6f65a60e33f5>> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -244,14 +244,16 @@ final class ClassnameTypeSpecifier extends Node implements ITypeSpecifier { } /** - * @return GenericTypeSpecifier | null | SimpleTypeSpecifier | TypeConstant + * @return GenericTypeSpecifier | null | SimpleTypeSpecifier | TypeConstant | + * TypeRefinement */ public function getType(): ?ITypeSpecifier { return $this->_type; } /** - * @return GenericTypeSpecifier | SimpleTypeSpecifier | TypeConstant + * @return GenericTypeSpecifier | SimpleTypeSpecifier | TypeConstant | + * TypeRefinement */ public function getTypex(): ITypeSpecifier { return TypeAssert\not_null($this->getType()); diff --git a/codegen/syntax/ClosureParameterTypeSpecifier.hack b/codegen/syntax/ClosureParameterTypeSpecifier.hack index e39b2efd..f7675062 100644 --- a/codegen/syntax/ClosureParameterTypeSpecifier.hack +++ b/codegen/syntax/ClosureParameterTypeSpecifier.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<55d72fb9278f435bc783fac6b2270095>> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -193,8 +193,8 @@ final class ClosureParameterTypeSpecifier /** * @return AttributizedSpecifier | ClosureTypeSpecifier | DarrayTypeSpecifier - * | GenericTypeSpecifier | NullableTypeSpecifier | SimpleTypeSpecifier | - * TupleTypeSpecifier | TypeConstant + * | DictionaryTypeSpecifier | GenericTypeSpecifier | NullableTypeSpecifier | + * SimpleTypeSpecifier | TupleTypeSpecifier | TypeConstant */ public function getType(): ITypeSpecifier { return TypeAssert\instance_of(ITypeSpecifier::class, $this->_type); @@ -202,8 +202,8 @@ final class ClosureParameterTypeSpecifier /** * @return AttributizedSpecifier | ClosureTypeSpecifier | DarrayTypeSpecifier - * | GenericTypeSpecifier | NullableTypeSpecifier | SimpleTypeSpecifier | - * TupleTypeSpecifier | TypeConstant + * | DictionaryTypeSpecifier | GenericTypeSpecifier | NullableTypeSpecifier | + * SimpleTypeSpecifier | TupleTypeSpecifier | TypeConstant */ public function getTypex(): ITypeSpecifier { return $this->getType(); diff --git a/codegen/syntax/ClosureTypeSpecifier.hack b/codegen/syntax/ClosureTypeSpecifier.hack index b509b90a..62444454 100644 --- a/codegen/syntax/ClosureTypeSpecifier.hack +++ b/codegen/syntax/ClosureTypeSpecifier.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<9c84879ef1b8682f02bbf8aafc171109>> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -662,7 +662,8 @@ final class ClosureTypeSpecifier extends Node implements ITypeSpecifier { /** * @return ClosureTypeSpecifier | GenericTypeSpecifier | LikeTypeSpecifier | - * NullableTypeSpecifier | SimpleTypeSpecifier | VectorTypeSpecifier + * NullableTypeSpecifier | SimpleTypeSpecifier | TypeRefinement | + * VectorTypeSpecifier */ public function getReturnType(): ITypeSpecifier { return TypeAssert\instance_of(ITypeSpecifier::class, $this->_return_type); @@ -670,7 +671,8 @@ final class ClosureTypeSpecifier extends Node implements ITypeSpecifier { /** * @return ClosureTypeSpecifier | GenericTypeSpecifier | LikeTypeSpecifier | - * NullableTypeSpecifier | SimpleTypeSpecifier | VectorTypeSpecifier + * NullableTypeSpecifier | SimpleTypeSpecifier | TypeRefinement | + * VectorTypeSpecifier */ public function getReturnTypex(): ITypeSpecifier { return $this->getReturnType(); diff --git a/codegen/syntax/EnumClassDeclaration.hack b/codegen/syntax/EnumClassDeclaration.hack index dc47a5dc..f9d23cfb 100644 --- a/codegen/syntax/EnumClassDeclaration.hack +++ b/codegen/syntax/EnumClassDeclaration.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<71ee494596dad01a0be73d16ce53f8f8>> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -15,7 +15,7 @@ final class EnumClassDeclaration extends Node { const string SYNTAX_KIND = 'enum_class_declaration'; private ?OldAttributeSpecification $_attribute_spec; - private ?NodeList $_modifiers; + private ?NodeList $_modifiers; private EnumToken $_enum_keyword; private ClassToken $_class_keyword; private NameToken $_name; @@ -29,7 +29,7 @@ final class EnumClassDeclaration extends Node { public function __construct( ?OldAttributeSpecification $attribute_spec, - ?NodeList $modifiers, + ?NodeList $modifiers, EnumToken $enum_keyword, ClassToken $class_keyword, NameToken $name, @@ -81,7 +81,7 @@ final class EnumClassDeclaration extends Node { $file, $offset, $source, - 'NodeList', + 'NodeList', ); $offset += $modifiers?->getWidth() ?? 0; $enum_keyword = Node::fromJSON( @@ -258,7 +258,7 @@ final class EnumClassDeclaration extends Node { } return new static( $attribute_spec as ?OldAttributeSpecification, - /* HH_FIXME[4110] ?NodeList may not be enforceable */ $modifiers, + /* HH_FIXME[4110] ?NodeList may not be enforceable */ $modifiers, $enum_keyword as EnumToken, $class_keyword as ClassToken, $name as NameToken, @@ -318,7 +318,7 @@ final class EnumClassDeclaration extends Node { return $this->_modifiers; } - public function withModifiers(?NodeList $value): this { + public function withModifiers(?NodeList $value): this { if ($value === $this->_modifiers) { return $this; } @@ -343,18 +343,16 @@ final class EnumClassDeclaration extends Node { } /** - * @return NodeList | NodeList | - * NodeList | null + * @return NodeList | null */ - public function getModifiers(): ?NodeList { + public function getModifiers(): ?NodeList { return $this->_modifiers; } /** - * @return NodeList | NodeList | - * NodeList + * @return NodeList */ - public function getModifiersx(): NodeList { + public function getModifiersx(): NodeList { return TypeAssert\not_null($this->getModifiers()); } diff --git a/codegen/syntax/EnumDeclaration.hack b/codegen/syntax/EnumDeclaration.hack index 2b9b023b..82dc3477 100644 --- a/codegen/syntax/EnumDeclaration.hack +++ b/codegen/syntax/EnumDeclaration.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<194693a524b90d5d00f80feff66c9e73>> + * @generated SignedSource<<23c47098179517a5b778b258f67ac93d>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -15,7 +15,7 @@ final class EnumDeclaration extends Node implements IHasAttributeSpec { const string SYNTAX_KIND = 'enum_declaration'; private ?OldAttributeSpecification $_attribute_spec; - private ?NodeList $_modifiers; + private ?Node $_modifiers; private EnumToken $_keyword; private NameToken $_name; private ColonToken $_colon; @@ -28,7 +28,7 @@ final class EnumDeclaration extends Node implements IHasAttributeSpec { public function __construct( ?OldAttributeSpecification $attribute_spec, - ?NodeList $modifiers, + ?Node $modifiers, EnumToken $keyword, NameToken $name, ColonToken $colon, @@ -76,7 +76,7 @@ final class EnumDeclaration extends Node implements IHasAttributeSpec { $file, $offset, $source, - 'NodeList', + 'Node', ); $offset += $modifiers?->getWidth() ?? 0; $keyword = Node::fromJSON( @@ -239,7 +239,7 @@ final class EnumDeclaration extends Node implements IHasAttributeSpec { } return new static( $attribute_spec as ?OldAttributeSpecification, - /* HH_FIXME[4110] ?NodeList may not be enforceable */ $modifiers, + $modifiers as ?Node, $keyword as EnumToken, $name as NameToken, $colon as ColonToken, @@ -297,7 +297,7 @@ final class EnumDeclaration extends Node implements IHasAttributeSpec { return $this->_modifiers; } - public function withModifiers(?NodeList $value): this { + public function withModifiers(?Node $value): this { if ($value === $this->_modifiers) { return $this; } @@ -321,16 +321,16 @@ final class EnumDeclaration extends Node implements IHasAttributeSpec { } /** - * @return NodeList | null + * @return null */ - public function getModifiers(): ?NodeList { + public function getModifiers(): ?Node { return $this->_modifiers; } /** - * @return NodeList + * @return */ - public function getModifiersx(): NodeList { + public function getModifiersx(): Node { return TypeAssert\not_null($this->getModifiers()); } diff --git a/codegen/syntax/FunctionDeclarationHeader.hack b/codegen/syntax/FunctionDeclarationHeader.hack index 1729471a..1d07a285 100644 --- a/codegen/syntax/FunctionDeclarationHeader.hack +++ b/codegen/syntax/FunctionDeclarationHeader.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<24665462d5c5e66ed6bc35d92fc9b6b1>> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -303,9 +303,9 @@ final class FunctionDeclarationHeader extends Node { /** * @return NodeList | NodeList | NodeList | - * NodeList | NodeList | NodeList | - * NodeList | NodeList | NodeList - * | NodeList | null + * NodeList | NodeList | NodeList | + * NodeList | NodeList | NodeList | + * null */ public function getModifiers(): ?NodeList { return $this->_modifiers; @@ -313,9 +313,8 @@ final class FunctionDeclarationHeader extends Node { /** * @return NodeList | NodeList | NodeList | - * NodeList | NodeList | NodeList | - * NodeList | NodeList | NodeList - * | NodeList + * NodeList | NodeList | NodeList | + * NodeList | NodeList | NodeList */ public function getModifiersx(): NodeList { return TypeAssert\not_null($this->getModifiers()); @@ -736,8 +735,8 @@ final class FunctionDeclarationHeader extends Node { * ClosureTypeSpecifier | DarrayTypeSpecifier | DictionaryTypeSpecifier | * GenericTypeSpecifier | KeysetTypeSpecifier | LikeTypeSpecifier | null | * NullableTypeSpecifier | ShapeTypeSpecifier | SimpleTypeSpecifier | - * NoreturnToken | TupleTypeSpecifier | TypeConstant | VarrayTypeSpecifier | - * VectorTypeSpecifier + * NoreturnToken | TupleTypeSpecifier | TypeConstant | TypeRefinement | + * VarrayTypeSpecifier | VectorTypeSpecifier */ public function getType(): ?ITypeSpecifier { return $this->_type; @@ -748,8 +747,8 @@ final class FunctionDeclarationHeader extends Node { * ClosureTypeSpecifier | DarrayTypeSpecifier | DictionaryTypeSpecifier | * GenericTypeSpecifier | KeysetTypeSpecifier | LikeTypeSpecifier | * NullableTypeSpecifier | ShapeTypeSpecifier | SimpleTypeSpecifier | - * NoreturnToken | TupleTypeSpecifier | TypeConstant | VarrayTypeSpecifier | - * VectorTypeSpecifier + * NoreturnToken | TupleTypeSpecifier | TypeConstant | TypeRefinement | + * VarrayTypeSpecifier | VectorTypeSpecifier */ public function getTypex(): ITypeSpecifier { return TypeAssert\not_null($this->getType()); diff --git a/codegen/syntax/ModuleDeclaration.hack b/codegen/syntax/ModuleDeclaration.hack index 97f24c72..59829e92 100644 --- a/codegen/syntax/ModuleDeclaration.hack +++ b/codegen/syntax/ModuleDeclaration.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<1d1fb415307f0976061bdb3cbad664a8>> + * @generated SignedSource<<04ce291c75a90778876e136f06fb298d>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -14,7 +14,7 @@ final class ModuleDeclaration extends Node { const string SYNTAX_KIND = 'module_declaration'; - private ?OldAttributeSpecification $_attribute_spec; + private OldAttributeSpecification $_attribute_spec; private NewToken $_new_keyword; private ModuleToken $_module_keyword; private ModuleName $_name; @@ -24,7 +24,7 @@ final class ModuleDeclaration extends Node { private RightBraceToken $_right_brace; public function __construct( - ?OldAttributeSpecification $attribute_spec, + OldAttributeSpecification $attribute_spec, NewToken $new_keyword, ModuleToken $module_keyword, ModuleName $name, @@ -55,14 +55,14 @@ final class ModuleDeclaration extends Node { ): this { $offset = $initial_offset; $attribute_spec = Node::fromJSON( - ($json['module_declaration_attribute_spec'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['module_declaration_attribute_spec']) as dict<_, _>, $file, $offset, $source, 'OldAttributeSpecification', ); - $offset += $attribute_spec?->getWidth() ?? 0; + $attribute_spec = $attribute_spec as nonnull; + $offset += $attribute_spec->getWidth(); $new_keyword = Node::fromJSON( ($json['module_declaration_new_keyword']) as dict<_, _>, $file, @@ -166,9 +166,7 @@ final class ModuleDeclaration extends Node { vec $parents = vec[], ): this { $parents[] = $this; - $attribute_spec = $this->_attribute_spec === null - ? null - : $rewriter($this->_attribute_spec, $parents); + $attribute_spec = $rewriter($this->_attribute_spec, $parents); $new_keyword = $rewriter($this->_new_keyword, $parents); $module_keyword = $rewriter($this->_module_keyword, $parents); $name = $rewriter($this->_name, $parents); @@ -191,7 +189,7 @@ final class ModuleDeclaration extends Node { return $this; } return new static( - $attribute_spec as ?OldAttributeSpecification, + $attribute_spec as OldAttributeSpecification, $new_keyword as NewToken, $module_keyword as ModuleToken, $name as ModuleName, @@ -206,7 +204,7 @@ final class ModuleDeclaration extends Node { return $this->_attribute_spec; } - public function withAttributeSpec(?OldAttributeSpecification $value): this { + public function withAttributeSpec(OldAttributeSpecification $value): this { if ($value === $this->_attribute_spec) { return $this; } @@ -223,21 +221,24 @@ final class ModuleDeclaration extends Node { } public function hasAttributeSpec(): bool { - return $this->_attribute_spec !== null; + return true; } /** - * @return null | OldAttributeSpecification + * @return OldAttributeSpecification */ - public function getAttributeSpec(): ?OldAttributeSpecification { - return $this->_attribute_spec; + public function getAttributeSpec(): OldAttributeSpecification { + return TypeAssert\instance_of( + OldAttributeSpecification::class, + $this->_attribute_spec, + ); } /** * @return OldAttributeSpecification */ public function getAttributeSpecx(): OldAttributeSpecification { - return TypeAssert\not_null($this->getAttributeSpec()); + return $this->getAttributeSpec(); } public function getNewKeywordUNTYPED(): ?Node { diff --git a/codegen/syntax/ParameterDeclaration.hack b/codegen/syntax/ParameterDeclaration.hack index d5fde3ed..f40e005a 100644 --- a/codegen/syntax/ParameterDeclaration.hack +++ b/codegen/syntax/ParameterDeclaration.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<1a479503fe3a347962036a518871ea84>> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -371,7 +371,7 @@ final class ParameterDeclaration * DarrayTypeSpecifier | DictionaryTypeSpecifier | GenericTypeSpecifier | * KeysetTypeSpecifier | LikeTypeSpecifier | null | NullableTypeSpecifier | * ShapeTypeSpecifier | SimpleTypeSpecifier | TupleTypeSpecifier | - * TypeConstant | VarrayTypeSpecifier | VectorTypeSpecifier + * TypeConstant | TypeRefinement | VarrayTypeSpecifier | VectorTypeSpecifier */ public function getType(): ?ITypeSpecifier { return $this->_type; @@ -382,7 +382,7 @@ final class ParameterDeclaration * DarrayTypeSpecifier | DictionaryTypeSpecifier | GenericTypeSpecifier | * KeysetTypeSpecifier | LikeTypeSpecifier | NullableTypeSpecifier | * ShapeTypeSpecifier | SimpleTypeSpecifier | TupleTypeSpecifier | - * TypeConstant | VarrayTypeSpecifier | VectorTypeSpecifier + * TypeConstant | TypeRefinement | VarrayTypeSpecifier | VectorTypeSpecifier */ public function getTypex(): ITypeSpecifier { return TypeAssert\not_null($this->getType()); diff --git a/codegen/syntax/PropertyDeclaration.hack b/codegen/syntax/PropertyDeclaration.hack index 75c1bb1c..f968672a 100644 --- a/codegen/syntax/PropertyDeclaration.hack +++ b/codegen/syntax/PropertyDeclaration.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -207,16 +207,16 @@ final class PropertyDeclaration } /** - * @return NodeList | NodeList | NodeList - * | NodeList | NodeList | NodeList + * @return NodeList | NodeList | + * NodeList | NodeList | NodeList */ public function getModifiers(): NodeList { return TypeAssert\instance_of(NodeList::class, $this->_modifiers); } /** - * @return NodeList | NodeList | NodeList - * | NodeList | NodeList | NodeList + * @return NodeList | NodeList | + * NodeList | NodeList | NodeList */ public function getModifiersx(): NodeList { return $this->getModifiers(); diff --git a/codegen/syntax/RequireClause.hack b/codegen/syntax/RequireClause.hack index 985e374c..854d80ae 100644 --- a/codegen/syntax/RequireClause.hack +++ b/codegen/syntax/RequireClause.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<826a6631b25eebc933ad97717e787801>> + * @generated SignedSource<<1942cefd059c3c71fffb9e761ebf16ca>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -175,14 +175,14 @@ final class RequireClause extends Node implements IClassBodyDeclaration { } /** - * @return ExtendsToken | ImplementsToken + * @return ClassToken | ExtendsToken | ImplementsToken */ public function getKind(): Token { return TypeAssert\instance_of(Token::class, $this->_kind); } /** - * @return ExtendsToken | ImplementsToken + * @return ClassToken | ExtendsToken | ImplementsToken */ public function getKindx(): Token { return $this->getKind(); diff --git a/codegen/syntax/TypeArguments.hack b/codegen/syntax/TypeArguments.hack index e32ee680..0fe338f5 100644 --- a/codegen/syntax/TypeArguments.hack +++ b/codegen/syntax/TypeArguments.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<8da116ce9939abde432f646389ec149e>> + * @generated SignedSource<<8da42f4704613d0a958b1a0834e668fe>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -172,7 +172,8 @@ final class TypeArguments extends Node { * NodeList> | * NodeList> | * NodeList> | NodeList> - * | NodeList> | + * | NodeList> | + * NodeList> | * NodeList> | null */ public function getTypes(): ?NodeList> { @@ -194,7 +195,8 @@ final class TypeArguments extends Node { * NodeList> | * NodeList> | * NodeList> | NodeList> - * | NodeList> | + * | NodeList> | + * NodeList> | * NodeList> */ public function getTypesx(): NodeList> { diff --git a/codegen/syntax/TypeConstraint.hack b/codegen/syntax/TypeConstraint.hack index ee8beb2c..31cf0152 100644 --- a/codegen/syntax/TypeConstraint.hack +++ b/codegen/syntax/TypeConstraint.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<8e3130923200461713699d8467cb78a0>> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -137,7 +137,7 @@ final class TypeConstraint extends Node { /** * @return ClassnameTypeSpecifier | ClosureTypeSpecifier | * GenericTypeSpecifier | LikeTypeSpecifier | NullableTypeSpecifier | - * ShapeTypeSpecifier | SimpleTypeSpecifier | TypeConstant | + * ShapeTypeSpecifier | SimpleTypeSpecifier | TypeConstant | TypeRefinement | * VarrayTypeSpecifier | VectorTypeSpecifier */ public function getType(): ITypeSpecifier { @@ -147,7 +147,7 @@ final class TypeConstraint extends Node { /** * @return ClassnameTypeSpecifier | ClosureTypeSpecifier | * GenericTypeSpecifier | LikeTypeSpecifier | NullableTypeSpecifier | - * ShapeTypeSpecifier | SimpleTypeSpecifier | TypeConstant | + * ShapeTypeSpecifier | SimpleTypeSpecifier | TypeConstant | TypeRefinement | * VarrayTypeSpecifier | VectorTypeSpecifier */ public function getTypex(): ITypeSpecifier { diff --git a/codegen/syntax/TypeInRefinement.hack b/codegen/syntax/TypeInRefinement.hack index ee46e6ea..5c289a44 100644 --- a/codegen/syntax/TypeInRefinement.hack +++ b/codegen/syntax/TypeInRefinement.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<> + * @generated SignedSource<> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -14,20 +14,20 @@ final class TypeInRefinement extends Node { const string SYNTAX_KIND = 'type_in_refinement'; - private ?Node $_keyword; - private ?Node $_name; + private TypeToken $_keyword; + private NameToken $_name; private ?Node $_type_parameters; private ?Node $_constraints; - private ?Node $_equal; - private ?Node $_type; + private EqualToken $_equal; + private ITypeSpecifier $_type; public function __construct( - ?Node $keyword, - ?Node $name, + TypeToken $keyword, + NameToken $name, ?Node $type_parameters, ?Node $constraints, - ?Node $equal, - ?Node $type, + EqualToken $equal, + ITypeSpecifier $type, ?__Private\SourceRef $source_ref = null, ) { $this->_keyword = $keyword; @@ -49,23 +49,23 @@ final class TypeInRefinement extends Node { ): this { $offset = $initial_offset; $keyword = Node::fromJSON( - ($json['type_in_refinement_keyword'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_in_refinement_keyword']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'TypeToken', ); - $offset += $keyword?->getWidth() ?? 0; + $keyword = $keyword as nonnull; + $offset += $keyword->getWidth(); $name = Node::fromJSON( - ($json['type_in_refinement_name'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_in_refinement_name']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'NameToken', ); - $offset += $name?->getWidth() ?? 0; + $name = $name as nonnull; + $offset += $name->getWidth(); $type_parameters = Node::fromJSON( ($json['type_in_refinement_type_parameters'] ?? dict['kind' => 'missing']) as dict<_, _>, @@ -85,23 +85,23 @@ final class TypeInRefinement extends Node { ); $offset += $constraints?->getWidth() ?? 0; $equal = Node::fromJSON( - ($json['type_in_refinement_equal'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_in_refinement_equal']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'EqualToken', ); - $offset += $equal?->getWidth() ?? 0; + $equal = $equal as nonnull; + $offset += $equal->getWidth(); $type = Node::fromJSON( - ($json['type_in_refinement_type'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_in_refinement_type']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'ITypeSpecifier', ); - $offset += $type?->getWidth() ?? 0; + $type = $type as nonnull; + $offset += $type->getWidth(); $source_ref = shape( 'file' => $file, 'source' => $source, @@ -138,17 +138,16 @@ final class TypeInRefinement extends Node { vec $parents = vec[], ): this { $parents[] = $this; - $keyword = - $this->_keyword === null ? null : $rewriter($this->_keyword, $parents); - $name = $this->_name === null ? null : $rewriter($this->_name, $parents); + $keyword = $rewriter($this->_keyword, $parents); + $name = $rewriter($this->_name, $parents); $type_parameters = $this->_type_parameters === null ? null : $rewriter($this->_type_parameters, $parents); $constraints = $this->_constraints === null ? null : $rewriter($this->_constraints, $parents); - $equal = $this->_equal === null ? null : $rewriter($this->_equal, $parents); - $type = $this->_type === null ? null : $rewriter($this->_type, $parents); + $equal = $rewriter($this->_equal, $parents); + $type = $rewriter($this->_type, $parents); if ( $keyword === $this->_keyword && $name === $this->_name && @@ -160,12 +159,12 @@ final class TypeInRefinement extends Node { return $this; } return new static( - $keyword as ?Node, - $name as ?Node, + $keyword as TypeToken, + $name as NameToken, $type_parameters as ?Node, $constraints as ?Node, - $equal as ?Node, - $type as ?Node, + $equal as EqualToken, + $type as ITypeSpecifier, ); } @@ -173,7 +172,7 @@ final class TypeInRefinement extends Node { return $this->_keyword; } - public function withKeyword(?Node $value): this { + public function withKeyword(TypeToken $value): this { if ($value === $this->_keyword) { return $this; } @@ -188,28 +187,28 @@ final class TypeInRefinement extends Node { } public function hasKeyword(): bool { - return $this->_keyword !== null; + return true; } /** - * @return unknown + * @return TypeToken */ - public function getKeyword(): ?Node { - return $this->_keyword; + public function getKeyword(): TypeToken { + return TypeAssert\instance_of(TypeToken::class, $this->_keyword); } /** - * @return unknown + * @return TypeToken */ - public function getKeywordx(): Node { - return TypeAssert\not_null($this->getKeyword()); + public function getKeywordx(): TypeToken { + return $this->getKeyword(); } public function getNameUNTYPED(): ?Node { return $this->_name; } - public function withName(?Node $value): this { + public function withName(NameToken $value): this { if ($value === $this->_name) { return $this; } @@ -224,21 +223,21 @@ final class TypeInRefinement extends Node { } public function hasName(): bool { - return $this->_name !== null; + return true; } /** - * @return unknown + * @return NameToken */ - public function getName(): ?Node { - return $this->_name; + public function getName(): NameToken { + return TypeAssert\instance_of(NameToken::class, $this->_name); } /** - * @return unknown + * @return NameToken */ - public function getNamex(): Node { - return TypeAssert\not_null($this->getName()); + public function getNamex(): NameToken { + return $this->getName(); } public function getTypeParametersUNTYPED(): ?Node { @@ -264,14 +263,14 @@ final class TypeInRefinement extends Node { } /** - * @return unknown + * @return null */ public function getTypeParameters(): ?Node { return $this->_type_parameters; } /** - * @return unknown + * @return */ public function getTypeParametersx(): Node { return TypeAssert\not_null($this->getTypeParameters()); @@ -300,14 +299,14 @@ final class TypeInRefinement extends Node { } /** - * @return unknown + * @return null */ public function getConstraints(): ?Node { return $this->_constraints; } /** - * @return unknown + * @return */ public function getConstraintsx(): Node { return TypeAssert\not_null($this->getConstraints()); @@ -317,7 +316,7 @@ final class TypeInRefinement extends Node { return $this->_equal; } - public function withEqual(?Node $value): this { + public function withEqual(EqualToken $value): this { if ($value === $this->_equal) { return $this; } @@ -332,28 +331,28 @@ final class TypeInRefinement extends Node { } public function hasEqual(): bool { - return $this->_equal !== null; + return true; } /** - * @return unknown + * @return EqualToken */ - public function getEqual(): ?Node { - return $this->_equal; + public function getEqual(): EqualToken { + return TypeAssert\instance_of(EqualToken::class, $this->_equal); } /** - * @return unknown + * @return EqualToken */ - public function getEqualx(): Node { - return TypeAssert\not_null($this->getEqual()); + public function getEqualx(): EqualToken { + return $this->getEqual(); } public function getTypeUNTYPED(): ?Node { return $this->_type; } - public function withType(?Node $value): this { + public function withType(ITypeSpecifier $value): this { if ($value === $this->_type) { return $this; } @@ -368,20 +367,20 @@ final class TypeInRefinement extends Node { } public function hasType(): bool { - return $this->_type !== null; + return true; } /** - * @return unknown + * @return SimpleTypeSpecifier | TypeConstant */ - public function getType(): ?Node { - return $this->_type; + public function getType(): ITypeSpecifier { + return TypeAssert\instance_of(ITypeSpecifier::class, $this->_type); } /** - * @return unknown + * @return SimpleTypeSpecifier | TypeConstant */ - public function getTypex(): Node { - return TypeAssert\not_null($this->getType()); + public function getTypex(): ITypeSpecifier { + return $this->getType(); } } diff --git a/codegen/syntax/TypeRefinement.hack b/codegen/syntax/TypeRefinement.hack index 292dc667..7ca2a27c 100644 --- a/codegen/syntax/TypeRefinement.hack +++ b/codegen/syntax/TypeRefinement.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<5d70129e8b4a9122aa71ad95ebd43544>> + * @generated SignedSource<<5eda3e9569f6db8ae3b00fdfe2be6d1d>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -14,18 +14,18 @@ final class TypeRefinement extends Node implements ITypeSpecifier { const string SYNTAX_KIND = 'type_refinement'; - private ?Node $_type; - private ?Node $_keyword; - private ?Node $_left_brace; - private ?Node $_members; - private ?Node $_right_brace; + private SimpleTypeSpecifier $_type; + private WithToken $_keyword; + private LeftBraceToken $_left_brace; + private NodeList> $_members; + private RightBraceToken $_right_brace; public function __construct( - ?Node $type, - ?Node $keyword, - ?Node $left_brace, - ?Node $members, - ?Node $right_brace, + SimpleTypeSpecifier $type, + WithToken $keyword, + LeftBraceToken $left_brace, + NodeList> $members, + RightBraceToken $right_brace, ?__Private\SourceRef $source_ref = null, ) { $this->_type = $type; @@ -46,50 +46,50 @@ final class TypeRefinement extends Node implements ITypeSpecifier { ): this { $offset = $initial_offset; $type = Node::fromJSON( - ($json['type_refinement_type'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_refinement_type']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'SimpleTypeSpecifier', ); - $offset += $type?->getWidth() ?? 0; + $type = $type as nonnull; + $offset += $type->getWidth(); $keyword = Node::fromJSON( - ($json['type_refinement_keyword'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_refinement_keyword']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'WithToken', ); - $offset += $keyword?->getWidth() ?? 0; + $keyword = $keyword as nonnull; + $offset += $keyword->getWidth(); $left_brace = Node::fromJSON( - ($json['type_refinement_left_brace'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_refinement_left_brace']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'LeftBraceToken', ); - $offset += $left_brace?->getWidth() ?? 0; + $left_brace = $left_brace as nonnull; + $offset += $left_brace->getWidth(); $members = Node::fromJSON( - ($json['type_refinement_members'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_refinement_members']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'NodeList>', ); - $offset += $members?->getWidth() ?? 0; + $members = $members as nonnull; + $offset += $members->getWidth(); $right_brace = Node::fromJSON( - ($json['type_refinement_right_brace'] ?? dict['kind' => 'missing']) - as dict<_, _>, + ($json['type_refinement_right_brace']) as dict<_, _>, $file, $offset, $source, - 'Node', + 'RightBraceToken', ); - $offset += $right_brace?->getWidth() ?? 0; + $right_brace = $right_brace as nonnull; + $offset += $right_brace->getWidth(); $source_ref = shape( 'file' => $file, 'source' => $source, @@ -124,17 +124,11 @@ final class TypeRefinement extends Node implements ITypeSpecifier { vec $parents = vec[], ): this { $parents[] = $this; - $type = $this->_type === null ? null : $rewriter($this->_type, $parents); - $keyword = - $this->_keyword === null ? null : $rewriter($this->_keyword, $parents); - $left_brace = $this->_left_brace === null - ? null - : $rewriter($this->_left_brace, $parents); - $members = - $this->_members === null ? null : $rewriter($this->_members, $parents); - $right_brace = $this->_right_brace === null - ? null - : $rewriter($this->_right_brace, $parents); + $type = $rewriter($this->_type, $parents); + $keyword = $rewriter($this->_keyword, $parents); + $left_brace = $rewriter($this->_left_brace, $parents); + $members = $rewriter($this->_members, $parents); + $right_brace = $rewriter($this->_right_brace, $parents); if ( $type === $this->_type && $keyword === $this->_keyword && @@ -145,11 +139,11 @@ final class TypeRefinement extends Node implements ITypeSpecifier { return $this; } return new static( - $type as ?Node, - $keyword as ?Node, - $left_brace as ?Node, - $members as ?Node, - $right_brace as ?Node, + $type as SimpleTypeSpecifier, + $keyword as WithToken, + $left_brace as LeftBraceToken, + /* HH_FIXME[4110] NodeList> may not be enforceable */ $members, + $right_brace as RightBraceToken, ); } @@ -157,7 +151,7 @@ final class TypeRefinement extends Node implements ITypeSpecifier { return $this->_type; } - public function withType(?Node $value): this { + public function withType(SimpleTypeSpecifier $value): this { if ($value === $this->_type) { return $this; } @@ -171,28 +165,28 @@ final class TypeRefinement extends Node implements ITypeSpecifier { } public function hasType(): bool { - return $this->_type !== null; + return true; } /** - * @return unknown + * @return SimpleTypeSpecifier */ - public function getType(): ?Node { - return $this->_type; + public function getType(): SimpleTypeSpecifier { + return TypeAssert\instance_of(SimpleTypeSpecifier::class, $this->_type); } /** - * @return unknown + * @return SimpleTypeSpecifier */ - public function getTypex(): Node { - return TypeAssert\not_null($this->getType()); + public function getTypex(): SimpleTypeSpecifier { + return $this->getType(); } public function getKeywordUNTYPED(): ?Node { return $this->_keyword; } - public function withKeyword(?Node $value): this { + public function withKeyword(WithToken $value): this { if ($value === $this->_keyword) { return $this; } @@ -206,28 +200,28 @@ final class TypeRefinement extends Node implements ITypeSpecifier { } public function hasKeyword(): bool { - return $this->_keyword !== null; + return true; } /** - * @return unknown + * @return WithToken */ - public function getKeyword(): ?Node { - return $this->_keyword; + public function getKeyword(): WithToken { + return TypeAssert\instance_of(WithToken::class, $this->_keyword); } /** - * @return unknown + * @return WithToken */ - public function getKeywordx(): Node { - return TypeAssert\not_null($this->getKeyword()); + public function getKeywordx(): WithToken { + return $this->getKeyword(); } public function getLeftBraceUNTYPED(): ?Node { return $this->_left_brace; } - public function withLeftBrace(?Node $value): this { + public function withLeftBrace(LeftBraceToken $value): this { if ($value === $this->_left_brace) { return $this; } @@ -241,28 +235,30 @@ final class TypeRefinement extends Node implements ITypeSpecifier { } public function hasLeftBrace(): bool { - return $this->_left_brace !== null; + return true; } /** - * @return unknown + * @return LeftBraceToken */ - public function getLeftBrace(): ?Node { - return $this->_left_brace; + public function getLeftBrace(): LeftBraceToken { + return TypeAssert\instance_of(LeftBraceToken::class, $this->_left_brace); } /** - * @return unknown + * @return LeftBraceToken */ - public function getLeftBracex(): Node { - return TypeAssert\not_null($this->getLeftBrace()); + public function getLeftBracex(): LeftBraceToken { + return $this->getLeftBrace(); } public function getMembersUNTYPED(): ?Node { return $this->_members; } - public function withMembers(?Node $value): this { + public function withMembers( + NodeList> $value, + ): this { if ($value === $this->_members) { return $this; } @@ -276,28 +272,28 @@ final class TypeRefinement extends Node implements ITypeSpecifier { } public function hasMembers(): bool { - return $this->_members !== null; + return true; } /** - * @return unknown + * @return NodeList> */ - public function getMembers(): ?Node { - return $this->_members; + public function getMembers(): NodeList> { + return TypeAssert\instance_of(NodeList::class, $this->_members); } /** - * @return unknown + * @return NodeList> */ - public function getMembersx(): Node { - return TypeAssert\not_null($this->getMembers()); + public function getMembersx(): NodeList> { + return $this->getMembers(); } public function getRightBraceUNTYPED(): ?Node { return $this->_right_brace; } - public function withRightBrace(?Node $value): this { + public function withRightBrace(RightBraceToken $value): this { if ($value === $this->_right_brace) { return $this; } @@ -311,20 +307,20 @@ final class TypeRefinement extends Node implements ITypeSpecifier { } public function hasRightBrace(): bool { - return $this->_right_brace !== null; + return true; } /** - * @return unknown + * @return RightBraceToken */ - public function getRightBrace(): ?Node { - return $this->_right_brace; + public function getRightBrace(): RightBraceToken { + return TypeAssert\instance_of(RightBraceToken::class, $this->_right_brace); } /** - * @return unknown + * @return RightBraceToken */ - public function getRightBracex(): Node { - return TypeAssert\not_null($this->getRightBrace()); + public function getRightBracex(): RightBraceToken { + return $this->getRightBrace(); } } diff --git a/codegen/syntax/WhereConstraint.hack b/codegen/syntax/WhereConstraint.hack index bca670f7..ef4a5d4e 100644 --- a/codegen/syntax/WhereConstraint.hack +++ b/codegen/syntax/WhereConstraint.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<82c89e9b354650c7f73cd2b9746122d3>> + * @generated SignedSource<<90c5e31c105e2a1bbe0b9843f1d8d824>> */ namespace Facebook\HHAST; use namespace Facebook\TypeAssert; @@ -191,7 +191,7 @@ final class WhereConstraint extends Node { /** * @return DictionaryTypeSpecifier | GenericTypeSpecifier | * NullableTypeSpecifier | SimpleTypeSpecifier | TypeConstant | - * VectorTypeSpecifier + * TypeRefinement | VectorTypeSpecifier */ public function getRightType(): ITypeSpecifier { return TypeAssert\instance_of(ITypeSpecifier::class, $this->_right_type); @@ -200,7 +200,7 @@ final class WhereConstraint extends Node { /** * @return DictionaryTypeSpecifier | GenericTypeSpecifier | * NullableTypeSpecifier | SimpleTypeSpecifier | TypeConstant | - * VectorTypeSpecifier + * TypeRefinement | VectorTypeSpecifier */ public function getRightTypex(): ITypeSpecifier { return $this->getRightType(); diff --git a/codegen/token_from_data.hack b/codegen/token_from_data.hack index e079f865..599b21db 100644 --- a/codegen/token_from_data.hack +++ b/codegen/token_from_data.hack @@ -1,7 +1,7 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<> + * @generated SignedSource<<7d078c309d4c59beeb06f60355a04722>> */ namespace Facebook\HHAST\__Private; use namespace Facebook\HHAST; @@ -101,6 +101,7 @@ final class TokenClassMap { 'noreturn' => HHAST\NoreturnToken::class, 'null' => HHAST\NullLiteralToken::class, 'num' => HHAST\NumToken::class, + 'package' => HHAST\PackageToken::class, 'parent' => HHAST\ParentToken::class, 'print' => HHAST\PrintToken::class, 'private' => HHAST\PrivateToken::class, diff --git a/codegen/version.hack b/codegen/version.hack index d3cd7036..66e7d69b 100644 --- a/codegen/version.hack +++ b/codegen/version.hack @@ -1,12 +1,12 @@ /** * This file is generated. Do not modify it manually! * - * @generated SignedSource<<3b8ecec1772f93b5d7eb54f1c249fab4>> + * @generated SignedSource<> */ namespace Facebook\HHAST; -const string SCHEMA_VERSION = '2022-08-10-0000'; +const string SCHEMA_VERSION = '2022-09-29-0000'; -const int HHVM_VERSION_ID = 416802; +const int HHVM_VERSION_ID = 417200; -const string HHVM_VERSION = '4.168.2'; +const string HHVM_VERSION = '4.172.0';