mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 09:37:59 +01:00
Fix
This commit is contained in:
parent
3437d762af
commit
f57d37a7f7
@ -1140,7 +1140,17 @@ class Reconciler
|
||||
} else {
|
||||
$properties = $base_atomic_type->properties;
|
||||
$properties[$array_key_offset] = $result_type;
|
||||
$base_atomic_type = $base_atomic_type->setProperties($properties);
|
||||
if ($base_atomic_type->is_list && !isset($properties[$array_key_offset-1])) {
|
||||
$base_atomic_type = new TKeyedArray(
|
||||
$properties,
|
||||
null,
|
||||
$base_atomic_type->fallback_params,
|
||||
false,
|
||||
$base_atomic_type->from_docblock
|
||||
);
|
||||
} else {
|
||||
$base_atomic_type = $base_atomic_type->setProperties($properties);
|
||||
}
|
||||
}
|
||||
|
||||
$new_base_type = $new_base_type->getBuilder()->addType($base_atomic_type)->freeze();
|
||||
|
@ -891,6 +891,18 @@ class RedundantConditionTest extends TestCase
|
||||
}
|
||||
}'
|
||||
],
|
||||
'countWithNeverValuesInKeyedList' => [
|
||||
'code' => '<?php
|
||||
/** @var non-empty-list $report_data */
|
||||
$report_data = [];
|
||||
if ( array_key_exists( 2, $report_data ) ) {
|
||||
} elseif ( !empty( $report_data[0]["type"] ) && rand(0,1) ) {
|
||||
if ( rand(0,1) ) {}
|
||||
|
||||
if ( count( $report_data ) === 1 ) {
|
||||
}
|
||||
}'
|
||||
],
|
||||
'secondFalsyTwiceWithChange' => [
|
||||
'code' => '<?php
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user