-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
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
Can't delcare variable type by comment #2178
Comments
Use |
In my version of Psalm it's still showing errors. My version is: Psalm 3.5.2@648dda67ed7aca1d4ea243258f0ee7f2844ac60a |
I added new
|
Yeah |
OK. I fix it to /** but I still have error.
getAttribute() method have return type is AbstractDataType but in this case it's return StringType (like in docblock; StringType extends AbstractDataType). And my result is:
And by the way, it's change in message my method name to lowercase (setconversion) and it should be 'setConversion'. |
OH currently You can fix in your example by putting the /** @var ?\Wszetko\Sitemap\Items\DataTypes\StringType */
$restrictionRelationship = $this->restriction
->getAttribute('relationship'); |
This example shouldn't show error: https://psalm.dev/r/f7478fba75
Psalm should respect variable declaration via @var tag.
The text was updated successfully, but these errors were encountered: