Skip to content

Commit

Permalink
handle MixedType
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Nov 8, 2021
1 parent 52b3b5e commit b85d018
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/NodeTypeResolver/NodeTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ public function getType(Node $node): Type
{
if ($node instanceof NullableType) {
$type = $this->getType($node->type);
return new UnionType([$type, new NullType()]);
if (! $type instanceof MixedType) {
return new UnionType([$type, new NullType()]);
}
}

if ($node instanceof Ternary) {
Expand Down

0 comments on commit b85d018

Please sign in to comment.