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

Wider support for psalm-import-type #9527

Closed
lstrojny opened this issue Mar 16, 2023 · 2 comments
Closed

Wider support for psalm-import-type #9527

lstrojny opened this issue Mar 16, 2023 · 2 comments

Comments

@lstrojny
Copy link
Contributor

ATM psalm type imports can only happen on a class level. Would be great if it would be supported on a function level as well. See https://psalm.dev/r/55c13f2794

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/55c13f2794
<?php
/**
 * @psalm-type Tp string
 */
class Foo {}


/**
 * @psalm-import-type Tp from Foo
 * @return Tp
 */
function f() {
    return 'val';
}
Psalm output (using commit 70a024f):

ERROR: PossiblyInvalidDocblockTag - 9:4 - Docblock tag @psalm-import-type is not recognized in the function docblock for f

@lstrojny
Copy link
Contributor Author

Duplicate of #4807

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

No branches or pull requests

1 participant