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 @@ -244,10 +244,15 @@ public function isSuperTypeOf(Type $otherType): IsSuperTypeOfResult
244244 return $ otherType ->isSubTypeOf ($ this );
245245 }
246246
247- $ result = IsSuperTypeOfResult::createNo ()->or (...array_map (static fn (Type $ innerType ) => $ innerType ->isSuperTypeOf ($ otherType ), $ this ->types ));
248- if ($ result ->yes ()) {
249- return $ result ;
247+ $ results = [];
248+ foreach ($ this ->types as $ innerType ) {
249+ $ result = $ innerType ->isSuperTypeOf ($ otherType );
250+ if ($ result ->yes ()) {
251+ return $ result ;
252+ }
253+ $ results [] = $ result ;
250254 }
255+ $ result = IsSuperTypeOfResult::createNo ()->or (...$ results );
251256
252257 if ($ otherType instanceof TemplateUnionType) {
253258 return $ result ->or ($ otherType ->isSubTypeOf ($ this ));
You can’t perform that action at this time.
0 commit comments