Skip to content

@psalm-import-type doesn't work with autoloaded files? #3999

@douggr

Description

@douggr

We have this (working) example: https://psalm.dev/r/531fd85425, which have only one file.

BUT, when we try to use @psalm-import-type among several files, psalm fails with ERROR: UndefinedDocblockClass - src/Error.php:16:19 - Docblock-defined class or interface DL2\PsalmIssue\TFoo does not exist (see https://psalm.dev/200).

Funny thing, it'll work if I add a constant within the class, but I don't want to.

I've created a simple example here: https://github.com/douggr/psalm-issues (clone, composer install && composer psalm)

So, my question is: how should I expect @psalm-import-type to work? Am I missing something?

I'm using psalm@dev-master:

$ ./vendor/bin/psalm --version
Psalm dev-master@bb3c5d4c388754d2e4789ddb515af0f995aa9d2f

refs #3816

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions