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
https://psalm.dev/r/40d5f10df0
Here it's saying the string literal 'foo' doesn't match the templated type which is string - can't see anything wrong?
'foo'
string
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php /** * @template T */ interface Norm { /** * @param T $input * @return T */ public function normalize(mixed $input): mixed; } /** * @implements Norm<string> */ class StringNorm implements Norm { public function normalize(mixed $input): mixed { return strtolower($input); } } /** * @template TNorm * * @param TNorm $value * @param Norm<TNorm> $n */ function normalizeField(mixed $value, Norm $n): void { $n->normalize($value); } normalizeField('foo', new StringNorm());
Psalm output (using commit 7869cb5): ERROR: InvalidArgument - 37:1 - Incompatible types found for TNorm ('foo' is not in string)
Sorry, something went wrong.
Fixed by #8731
Successfully merging a pull request may close this issue.
https://psalm.dev/r/40d5f10df0
Here it's saying the string literal
'foo'
doesn't match the templated type which isstring
- can't see anything wrong?The text was updated successfully, but these errors were encountered: