We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iterables have scalar keys, this means when unpacking an iterable when calling a function psalm should show an issue if the key isn't an int or a string. https://psalm.dev/r/c6f65aebef https://3v4l.org/Y8Vbu
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php /** * @template TValue * @implements Iterator<float, TValue> */ class FloatKeyIterator implements Iterator { /** @var int */ private $position = 0; /** @var list<array{float, TValue}> */ private $data = []; /** @param list<array{float, TValue}> $data */ public function __construct($data) { $this->data = $data; } /** @return TValue */ public function current() { return $this->data[$this->position][1]; } /** @return float */ public function key() { return $this->data[$this->position][0]; } public function next(): void { ++$this->position; } public function rewind(): void { $this->position = 0; } public function valid(): bool { return isset($this->data[$this->position]); } } /** @psalm-suppress UnusedParam */ function foo(string ...$args): void {} /** @var FloatKeyIterator<string> */ $test = new FloatKeyIterator([[3.14, 'pi'], [2.72, 'e']]); foo(...$test);
Psalm output (using commit 9f3f420): No issues!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Iterables have scalar keys, this means when unpacking an iterable when calling a function psalm should show an issue if the key isn't an int or a string.
https://psalm.dev/r/c6f65aebef
https://3v4l.org/Y8Vbu
The text was updated successfully, but these errors were encountered: