in src/consumers/typehints_from_ast.hack [15:26]
function typehints_from_ast(
ConsumerContext $context,
?HHAST\NodeList<HHAST\Node> $node,
): vec<ScannedTypehint> {
if ($node === null) {
return vec[];
}
return $node->getChildren()
|> Vec\map($$, $c ==> $c is HHAST\ListItem<_> ? $c->getItem() : $c)
|> Vec\map($$, $c ==> typehint_from_ast($context, $c))
|> Vec\filter_nulls($$);
}