1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Prevent removing null from single null type

This commit is contained in:
Matthew Brown 2019-05-27 00:12:57 -04:00
parent c356c452ec
commit 442c307b30

View File

@ -1010,7 +1010,7 @@ class Union
if ($input_type) {
$generic_param = clone $input_type;
if ($this->isNullable() && $generic_param->isNullable()) {
if ($this->isNullable() && $generic_param->isNullable() && !$generic_param->isNull()) {
$generic_param->removeType('null');
}