Skip to content

Commit 46e3ecd

Browse files
committed
More unification
1 parent 5e96761 commit 46e3ecd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Type/Generic/TemplateObjectWithoutClassType.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,12 @@ public function isSubTypeOf(Type $type): TrinaryLogic
155155
return TrinaryLogic::createYes();
156156
}
157157

158-
return $type->getBound()->isSuperTypeOf($this->getBound())
159-
->and(TrinaryLogic::createMaybe());
158+
if ($type->getBound()->isSuperTypeOf($this->getBound())->no() &&
159+
$this->getBound()->isSuperTypeOf($type->getBound())->no()) {
160+
return TrinaryLogic::createNo();
161+
}
162+
163+
return TrinaryLogic::createMaybe();
160164
}
161165

162166
public function inferTemplateTypes(Type $receivedType): TemplateTypeMap

0 commit comments

Comments
 (0)