File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -245,10 +245,15 @@ public function isSuperTypeOfWithReason(Type $otherType): IsSuperTypeOfResult
245245 return $ otherType ->isSubTypeOfWithReason ($ this );
246246 }
247247
248- $ result = IsSuperTypeOfResult::createNo ()->or (...array_map (static fn (Type $ innerType ) => $ innerType ->isSuperTypeOfWithReason ($ otherType ), $ this ->types ));
249- if ($ result ->yes ()) {
250- return $ result ;
248+ $ results = [];
249+ foreach ($ this ->types as $ innerType ) {
250+ $ result = $ innerType ->isSuperTypeOfWithReason ($ otherType );
251+ if ($ result ->yes ()) {
252+ return $ result ;
253+ }
254+ $ results [] = $ result ;
251255 }
256+ $ result = IsSuperTypeOfResult::createNo ()->or (...$ results );
252257
253258 if ($ otherType instanceof TemplateUnionType) {
254259 return $ result ->or ($ otherType ->isSubTypeOfWithReason ($ this ));
You can’t perform that action at this time.
0 commit comments