Skip to content

Commit

Permalink
Apply a suggested fix I left for myself on Github
Browse files Browse the repository at this point in the history
  • Loading branch information
lexidor committed Dec 24, 2023
1 parent 0d92f35 commit 0d0a265
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/__Private/codegen/CodegenSyntax.hack
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ final class CodegenSyntax extends CodegenBase {
$is_a_known_type = $is_node_listy && $rest === '<Node>' ||
$is_list_itemy && $rest === '<?Node>';

return
$is_a_known_type ? $expression.' as '.$open_generic : $best_effort_fixme;
return $upper_bound === $expected_type
? $expression.' as '.$open_generic
: $best_effort_fixme;
}
}

0 comments on commit 0d0a265

Please sign in to comment.