File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,16 @@ public static function isParametersAcceptorSuperTypeOf(
95
95
96
96
$ theirReturnType = $ theirs ->getReturnType ();
97
97
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
+ }
99
108
} else {
100
109
$ isReturnTypeSuperType = new AcceptsResult ($ ours ->getReturnType ()->isSuperTypeOf ($ theirReturnType ), []);
101
110
}
You can’t perform that action at this time.
0 commit comments