mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
This commit is contained in:
parent
d4590711d6
commit
b859fba52d
@ -762,6 +762,7 @@ class Union implements TypeNode
|
||||
|| isset($this->types['trait-string'])
|
||||
|| isset($this->types['numeric-string'])
|
||||
|| isset($this->types['callable-string'])
|
||||
|| isset($this->types['array-key'])
|
||||
|| $this->literal_string_types
|
||||
|| $this->typed_class_strings;
|
||||
}
|
||||
|
@ -1800,6 +1800,19 @@ class ArrayAssignmentTest extends TestCase
|
||||
}',
|
||||
'error_message' => 'DuplicateArrayKey'
|
||||
],
|
||||
'unpackArrayWithArrayKeyIntoArray' => [
|
||||
'<?php
|
||||
|
||||
/**
|
||||
* @param array<array-key, mixed> $data
|
||||
* @return list<mixed>
|
||||
*/
|
||||
function unpackArray(array $data): array
|
||||
{
|
||||
return [...$data];
|
||||
}',
|
||||
'error_message' => 'DuplicateArrayKey',
|
||||
],
|
||||
'ArrayCreateOffsetObject' => [
|
||||
'<?php
|
||||
$_a = [new stdClass => "a"];
|
||||
|
@ -1761,22 +1761,6 @@ class ArrayFunctionCallTest extends TestCase
|
||||
'error_levels' => [],
|
||||
'7.4',
|
||||
],
|
||||
'allowUnpackWithArrayKey' => [
|
||||
'<?php
|
||||
class Foo {
|
||||
protected function one(): array {
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function two(): array {
|
||||
return [];
|
||||
}
|
||||
|
||||
public function three(): array {
|
||||
return [...$this->one(), ...$this->two()];
|
||||
}
|
||||
}'
|
||||
],
|
||||
'spliceTurnsintKeyedInputToList' => [
|
||||
'<?php
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user