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

@psalm-template T of ... with additional comments is parsed incorrectly #9506

Closed
ptomulik opened this issue Mar 13, 2023 · 1 comment · Fixed by #9509
Closed

@psalm-template T of ... with additional comments is parsed incorrectly #9506

ptomulik opened this issue Mar 13, 2023 · 1 comment · Fixed by #9509

Comments

@ptomulik
Copy link
Contributor

https://psalm.dev/r/ebc33e6f34
https://psalm.dev/r/7ab8f17097

(the difference between above is just with '.' after lorem ipsum)

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/ebc33e6f34
<?php

/**
 * @psalm-template T of string
 *
 * lorem ipsum
 */
class Test {
    /** @psalm-param T $t */
    function t(mixed $t): void { /** @psalm-trace $t */; }
}
Psalm output (using commit 902a019):

ERROR: UndefinedClass - 9:22 - Class, interface or enum named stringloremipsum does not exist
https://psalm.dev/r/7ab8f17097
<?php

/**
 * @psalm-template T of string
 *
 * lorem ipsum.
 */
class Test {
    /** @psalm-param T $t */
    function t(mixed $t): void { /** @psalm-trace $t */; }
}
Psalm output (using commit 902a019):

ERROR: InvalidDocblock - 8:7 - Unexpected token . in docblock for Test

ERROR: UndefinedDocblockClass - 9:22 - Docblock-defined class, interface or enum named T does not exist

ptomulik added a commit to ptomulik/psalm that referenced this issue Mar 13, 2023
ptomulik added a commit to ptomulik/psalm that referenced this issue Mar 13, 2023
ptomulik added a commit to ptomulik/psalm that referenced this issue Mar 13, 2023
@ptomulik ptomulik mentioned this issue Mar 13, 2023
ptomulik added a commit to ptomulik/psalm that referenced this issue Mar 17, 2023
ptomulik added a commit to ptomulik/psalm that referenced this issue Mar 17, 2023
orklah added a commit that referenced this issue Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant