From 442c307b301d761285e21382be67674e428eb48e Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 27 May 2019 00:12:57 -0400 Subject: [PATCH] Prevent removing null from single null type --- src/Psalm/Type/Union.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Type/Union.php b/src/Psalm/Type/Union.php index fb9740d59fc..24d9f73275c 100644 --- a/src/Psalm/Type/Union.php +++ b/src/Psalm/Type/Union.php @@ -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'); }