From 0d0a265b1374ddafeecb6b29ee1ee54d6df8dc34 Mon Sep 17 00:00:00 2001 From: Lexidor Digital <31805625+lexidor@users.noreply.github.com> Date: Sun, 24 Dec 2023 14:21:38 +0100 Subject: [PATCH] Apply a suggested fix I left for myself on Github --- src/__Private/codegen/CodegenSyntax.hack | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/__Private/codegen/CodegenSyntax.hack b/src/__Private/codegen/CodegenSyntax.hack index 70b95e7e..777f5734 100644 --- a/src/__Private/codegen/CodegenSyntax.hack +++ b/src/__Private/codegen/CodegenSyntax.hack @@ -760,7 +760,8 @@ final class CodegenSyntax extends CodegenBase { $is_a_known_type = $is_node_listy && $rest === '' || $is_list_itemy && $rest === ''; - return - $is_a_known_type ? $expression.' as '.$open_generic : $best_effort_fixme; + return $upper_bound === $expected_type + ? $expression.' as '.$open_generic + : $best_effort_fixme; } }