Literal string considered `!string` by `is_string()`
https://psalm.dev/r/a232dce215
I found these snippets:
https://psalm.dev/r/a232dce215
<?php
$a = 'some';
if (!is_string($a)) {
throw new \Exception();
}
Psalm output (using commit 16b24bd):
ERROR: TypeDoesNotContainType - 5:6 - Type 'some' for $a is always !string
I think the program is telling you that in your example $a is always a string, so your if test does make sense (i.e. you're testing for something that is unequivocally known to be true).
I think the program is telling you that in your example
$ais always a string, so youriftest does make sense (i.e. you're testing for something that is unequivocally known to be true).
Sorry, but text says exatly opposite !string, which means it's not a string. I worry there could be a real bug rather than just error message typo.
Hm, I can see even the codebase contains the suppession of this type of errors: https://github.com/vimeo/psalm/blob/5.x/src/Psalm/Internal/Provider/FileStorageCacheProvider.php#L92
Is this known behavior or just a bug which was suppresed for a long time??