File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -282,13 +282,14 @@ public function inferTemplateTypes(Type $receivedType): TemplateTypeMap
282282 TemplateTypeVarianceMap::createEmpty (),
283283 TemplateTypeVariance::createStatic (),
284284 ));
285- if ($ resolvedBound ->isSuperTypeOf ($ receivedType )->yes ()) {
285+ $ boundMatches = $ resolvedBound ->isSuperTypeOf ($ receivedType );
286+ if ($ boundMatches ->yes ()) {
286287 return (new TemplateTypeMap ([
287288 $ this ->name => $ receivedType ,
288289 ]))->union ($ map );
289290 }
290291
291- if ($ receivedType instanceof UnionType) {
292+ if ($ boundMatches -> maybe () && $ receivedType instanceof UnionType) {
292293 $ matchingTypes = [];
293294 foreach ($ receivedType ->getTypes () as $ innerType ) {
294295 if (!$ resolvedBound ->isSuperTypeOf ($ innerType )->yes ()) {
You can’t perform that action at this time.
0 commit comments