mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
parent
bca3b1797c
commit
745acaea71
@ -221,6 +221,14 @@ abstract class Type
|
||||
$atomic_type = self::getTypeFromTree($child_tree, false, $template_type_names);
|
||||
}
|
||||
|
||||
if ($atomic_type instanceof Union) {
|
||||
foreach ($atomic_type->getTypes() as $type) {
|
||||
$atomic_types[] = $type;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$atomic_type instanceof Atomic) {
|
||||
throw new \UnexpectedValueException(
|
||||
'Was expecting an atomic type, got ' . get_class($atomic_type)
|
||||
|
@ -249,6 +249,11 @@ class TypeParseTest extends TestCase
|
||||
Type::parseString('(A|B)&C');
|
||||
}
|
||||
|
||||
public function testBracketInUnion()
|
||||
{
|
||||
Type::parseString('null|(scalar|array|object)');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user