public visitInstanceOf ( ast\Node $node ) : |
||
$node | ast\Node | A node of the type indicated by the method name that we'd like to figure out the type that it produces. |
return | The set of types that are possibly produced by the given node |
public function visitInstanceOf(Node $node) : UnionType
{
// Check to make sure the left side is valid
UnionType::fromNode($this->context, $this->code_base, $node->children['expr']);
try {
// Confirm that the right-side exists
$union_type = $this->visitClassNode($node->children['class']);
} catch (TypeException $exception) {
// TODO: log it?
}
return BoolType::instance()->asUnionType();
}