public addUnionType ( |
||
$union_type | ||
리턴 | null |
public function addUnionType(UnionType $union_type)
{
$this->type_set->addAll($union_type->getTypeSet());
}
public function visitConditional(Node $node) : UnionType { $union_type = new UnionType(); // Add the type for the 'true' side $union_type->addUnionType(UnionType::fromNode($this->context, $this->code_base, $node->children['trueExpr'] ?? $node->children['true'] ?? '')); // Add the type for the 'false' side $union_type->addUnionType(UnionType::fromNode($this->context, $this->code_base, $node->children['falseExpr'] ?? $node->children['false'] ?? '')); return $union_type; }