-
Notifications
You must be signed in to change notification settings - Fork 661
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
Looks like Psalm doesn't recognize class aliases #3465
Labels
Comments
I found these snippets: https://psalm.dev/r/c63cf9ad4b<?php
namespace UserException;
class UserException extends \Exception {
}
namespace Alias\UserException;
use function class_alias;
class_alias(
\UserException\UserException::class,
'\Alias\UserException\UserExceptionAlias'
);
namespace Client;
try {
throw new \Alias\UserException\UserExceptionAlias();
} catch (\Alias\UserException\UserExceptionAlias $e) {
var_dump($e);
}
|
Also, this: https://psalm.dev/r/15b31a80cf crashes. |
I found these snippets: https://psalm.dev/r/15b31a80cf<?php
namespace UserException;
class UserException extends \Exception {
}
namespace Alias\UserException;
use function class_alias;
class_alias(
\UserException\UserException::class,
\Alias\UserException\UserExceptionAlias::class
);
namespace Client;
try {
throw new \Alias\UserException\UserExceptionAlias();
} catch (\Alias\UserException\UserExceptionAlias $e) {
var_dump($e);
}
|
muglug
added a commit
that referenced
this issue
May 27, 2020
Seems like you can trigger the issue if you do this
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Faced with the issue with fatal error while psalm processing the project, it is failed on the
psalm --init
command when processing the line with class alias definitionthe exact example was
looks like due to class been moved into another namespace, psalm doesn't parse this
tried to simulate situation in the sandbox https://psalm.dev/r/c63cf9ad4b
The text was updated successfully, but these errors were encountered: