Skip to content

Commit

Permalink
feat: if template type has some constraints, they will be used to det…
Browse files Browse the repository at this point in the history
…ermine operation types
  • Loading branch information
romalytvynenko committed Sep 27, 2023
1 parent 3aed7a7 commit 75bad2d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Infer/Scope/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ public function getType(Node $node): Type

$calleeType = $this->getType($node->var);
if ($calleeType instanceof TemplateType) {
// @todo
// if ($calleeType->is instanceof ObjectType) {
// $calleeType = $calleeType->is;
// }
return $this->setType($node, new UnknownType("Cannot infer type of method [{$node->name->name}] call on template type: not supported yet."));
if ($calleeType->is instanceof ObjectType) {
$calleeType = $calleeType->is;
} else {
return $this->setType($node, new UnknownType("Cannot infer type of method [{$node->name->name}] call on template type: not supported yet."));
}
}

return $this->setType(
Expand Down

0 comments on commit 75bad2d

Please sign in to comment.