Skip to content
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

Using a @var annotation on promoted property breaks with generic #8951

Closed
alex-dev opened this issue Dec 19, 2022 · 2 comments
Closed

Using a @var annotation on promoted property breaks with generic #8951

alex-dev opened this issue Dec 19, 2022 · 2 comments

Comments

@alex-dev
Copy link

With @var: https://psalm.dev/r/88aad69808
With @param: https://psalm.dev/r/f4a2e8938a

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/88aad69808
<?php

/** @template T */
class A {
	public function __construct(/** @var T */ private readonly mixed $project) {
	}
}
Psalm output (using commit 96cb44b):

ERROR: UndefinedDocblockClass - 5:44 - Docblock-defined class, interface or enum named T does not exist
https://psalm.dev/r/f4a2e8938a
<?php

/** @template T */
class A {
    /** @param T $project */
	public function __construct(private readonly mixed $project) {
	}
}
Psalm output (using commit 96cb44b):

No issues!

@klimick
Copy link
Contributor

klimick commented Jul 30, 2023

Issue fixed in #9092. It should be closed.

@danog danog closed this as completed Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants