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

Cannot import type from trait #8740

Closed
VincentLanglet opened this issue Nov 23, 2022 · 2 comments
Closed

Cannot import type from trait #8740

VincentLanglet opened this issue Nov 23, 2022 · 2 comments
Labels

Comments

@VincentLanglet
Copy link
Contributor

Hi, I would expect the following code to work fine.

https://psalm.dev/r/0eeb63fe59

Am I missing something ?

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/0eeb63fe59
<?php

namespace Src;

/**
 * @phpstan-type Rules = array{
 *     notImportant?: bool,
 * }
 */
trait Foo
{
}

namespace Test;

use Src\Foo;

/**
 * @phpstan-import-type Rules from Foo
 */
class Bar
{
}
Psalm output (using commit e83ac65):

ERROR: UndefinedDocblockClass - 19:25 - Docblock-defined class, interface or enum named Src\Foo does not exist

@orklah orklah added the traits label Dec 4, 2022
@weirdan
Copy link
Collaborator

weirdan commented Feb 9, 2024

Implemented in #10625

@weirdan weirdan closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants