1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00
This commit is contained in:
Daniil Gentili 2023-12-06 14:52:54 +01:00
parent d3b7f3f0b4
commit 76458e0b50

View File

@ -73,6 +73,20 @@ class ArrayAssignmentTest extends TestCase
'$result===' => 'array{a::class: true, b::class: true}', '$result===' => 'array{a::class: true, b::class: true}',
], ],
], ],
'assignUnionOfLiteralsClassKeys2' => [
'code' => '<?php
class a {}
class b {}
$result = ["c" => true];
foreach ([a::class, b::class] as $k) {
$result[$k] = true;
}',
'assertions' => [
'$result===' => 'array{a::class: true, b::class: true, c: true}',
],
],
'genericArrayCreationWithSingleIntValue' => [ 'genericArrayCreationWithSingleIntValue' => [
'code' => '<?php 'code' => '<?php
$out = []; $out = [];