Skip to content

Commit

Permalink
Prevent removing null from single null type
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed May 27, 2019
1 parent c356c45 commit 442c307
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psalm/Type/Union.php
Expand Up @@ -1010,7 +1010,7 @@ public function replaceTemplateTypesWithStandins(
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');
}

Expand Down

0 comments on commit 442c307

Please sign in to comment.