File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -282,11 +282,6 @@ public function inferTemplateTypes(Type $receivedType): TemplateTypeMap
282282 TemplateTypeVarianceMap::createEmpty (),
283283 TemplateTypeVariance::createStatic (),
284284 ));
285- if ($ resolvedBound ->isSuperTypeOf ($ receivedType )->yes ()) {
286- return (new TemplateTypeMap ([
287- $ this ->name => $ receivedType ,
288- ]))->union ($ map );
289- }
290285
291286 if ($ receivedType instanceof UnionType) {
292287 $ matchingTypes = [];
@@ -303,6 +298,10 @@ public function inferTemplateTypes(Type $receivedType): TemplateTypeMap
303298 $ this ->name => $ filteredType ,
304299 ]))->union ($ map );
305300 }
301+ } elseif ($ resolvedBound ->isSuperTypeOf ($ receivedType )->yes ()) {
302+ return (new TemplateTypeMap ([
303+ $ this ->name => $ receivedType ,
304+ ]))->union ($ map );
306305 }
307306
308307 return $ map ;
You can’t perform that action at this time.
0 commit comments