in codegen/syntax/TypeParameter.hack [43:115]
public static function fromJSON(
dict<arraykey, mixed> $json,
string $file,
int $initial_offset,
string $source,
string $_type_hint,
): this {
$offset = $initial_offset;
$attribute_spec = Node::fromJSON(
($json['type_attribute_spec'] ?? dict['kind' => 'missing']) as dict<_, _>,
$file,
$offset,
$source,
'OldAttributeSpecification',
);
$offset += $attribute_spec?->getWidth() ?? 0;
$reified = Node::fromJSON(
($json['type_reified'] ?? dict['kind' => 'missing']) as dict<_, _>,
$file,
$offset,
$source,
'ReifyToken',
);
$offset += $reified?->getWidth() ?? 0;
$variance = Node::fromJSON(
($json['type_variance'] ?? dict['kind' => 'missing']) as dict<_, _>,
$file,
$offset,
$source,
'Token',
);
$offset += $variance?->getWidth() ?? 0;
$name = Node::fromJSON(
($json['type_name']) as dict<_, _>,
$file,
$offset,
$source,
'NameToken',
);
$name = $name as nonnull;
$offset += $name->getWidth();
$param_params = Node::fromJSON(
($json['type_param_params'] ?? dict['kind' => 'missing']) as dict<_, _>,
$file,
$offset,
$source,
'TypeParameters',
);
$offset += $param_params?->getWidth() ?? 0;
$constraints = Node::fromJSON(
($json['type_constraints'] ?? dict['kind' => 'missing']) as dict<_, _>,
$file,
$offset,
$source,
'NodeList<TypeConstraint>',
);
$offset += $constraints?->getWidth() ?? 0;
$source_ref = shape(
'file' => $file,
'source' => $source,
'offset' => $initial_offset,
'width' => $offset - $initial_offset,
);
return new static(
/* HH_IGNORE_ERROR[4110] */ $attribute_spec,
/* HH_IGNORE_ERROR[4110] */ $reified,
/* HH_IGNORE_ERROR[4110] */ $variance,
/* HH_IGNORE_ERROR[4110] */ $name,
/* HH_IGNORE_ERROR[4110] */ $param_params,
/* HH_IGNORE_ERROR[4110] */ $constraints,
$source_ref,
);
}