Skip to content

Commit 1b3cffe

Browse files
committed
Revert "Fix CallableTypeHelper"
This reverts commit 3f40c9d.
1 parent 003ce1f commit 1b3cffe

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Type/CallableTypeHelper.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,16 @@ public static function isParametersAcceptorSuperTypeOf(
9595

9696
$theirReturnType = $theirs->getReturnType();
9797
if ($treatMixedAsAny) {
98-
$isReturnTypeSuperType = $ours->getReturnType()->acceptsWithReason($theirReturnType, true);
98+
if (
99+
$theirReturnType instanceof MixedType
100+
&& !$theirReturnType instanceof TemplateMixedType
101+
) {
102+
$isReturnTypeSuperType = new AcceptsResult(TrinaryLogic::createYes(), []);
103+
} elseif ($theirReturnType instanceof BenevolentUnionType) {
104+
$isReturnTypeSuperType = $ours->getReturnType()->acceptsWithReason($theirReturnType, true);
105+
} else {
106+
$isReturnTypeSuperType = new AcceptsResult($ours->getReturnType()->isSuperTypeOf($theirReturnType), []);
107+
}
99108
} else {
100109
$isReturnTypeSuperType = new AcceptsResult($ours->getReturnType()->isSuperTypeOf($theirReturnType), []);
101110
}

0 commit comments

Comments
 (0)