public visitUnaryOp ( 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 visitUnaryOp(Node $node) : UnionType
{
// Shortcut some easy operators
switch ($node->flags) {
case \ast\flags\UNARY_BOOL_NOT:
return BoolType::instance()->asUnionType();
}
return self::unionTypeFromNode($this->code_base, $this->context, $node->children['expr']);
}