diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 702c0718bfc..49462a40934 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + tags['variablesfrom'][0]]]> @@ -601,8 +601,6 @@ $const_name - $type[0] - $type[0][0] diff --git a/src/Psalm/Type/Reconciler.php b/src/Psalm/Type/Reconciler.php index 074ef233ab3..1ae92b40571 100644 --- a/src/Psalm/Type/Reconciler.php +++ b/src/Psalm/Type/Reconciler.php @@ -424,6 +424,10 @@ private static function addNestedAssertions(array $new_types, array $existing_ty { foreach ($new_types as $nk => $type) { if (strpos($nk, '[') || strpos($nk, '->')) { + $type = array_values($type); + if (!isset($type[0][0])) { + continue; + } if ($type[0][0] instanceof IsEqualIsset || $type[0][0] instanceof IsIsset || $type[0][0] instanceof NonEmpty