Skip to content

Commit

Permalink
add tests for vimeo#9433
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomulik committed Mar 1, 2023
1 parent 06266c2 commit 0d9a981
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/TypeReconciliation/IssetTest.php
Expand Up @@ -1153,6 +1153,25 @@ private function __construct() {}
}',
'error_message' => 'RedundantPropertyInitializationCheck',
],
'setArbitraryListElementAfterIsset' => [
'code' => '<?php
/** @param list<string> $list */
function foo(array &$list, int $offset): void {
if (isset($list[$offset])) {}
$list[$offset] = "";
}',
'error_message' => 'ReferenceConstraintViolation'
],
'setArbitraryListWithinNotIsset' => [
'code' => '<?php
/** @param list<string> $list */
function foo(array &$list, int $offset): void {
if (!isset($list[$offset])) {
$list[$offset] = "";
}
}',
'error_message' => 'ReferenceConstraintViolation'
],
];
}
}

0 comments on commit 0d9a981

Please sign in to comment.