I found these snippets:
https://psalm.dev/r/110bc828f0
<?php
final class A
{
/**
* @psalm-var non-empty-array<string, string>
*/
private array $nonEmptyArray = ['a' => 'b'];
/**
* @return non-empty-list<string>
*/
public function getKeys(): array
{
return array_keys($this->nonEmptyArray);
}
}
Psalm output (using commit 6f28ee6):
ERROR: InvalidReturnStatement - 15:16 - The inferred type 'list<string>' does not match the declared return type 'non-empty-list<string>' for A::getKeys
ERROR: InvalidReturnType - 11:16 - The declared return type 'non-empty-list<string>' for A::getKeys is incorrect, got 'list<string>'
Mind PRing this change? Should be simple enough
This is finally finally fixed