-
Notifications
You must be signed in to change notification settings - Fork 79
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
Why is QualifiedName::getResolvedName disabled for Node\TraitUseClause? #400
Comments
I don't know- I was just looking at the test cases and I'm not sure why you can use it on some code that references that name, but not in the |
Hi, thanks for the feedback. Maybe it has something to do with the crazy things you can do with the |
But then again, I can't imagine this be the reason... I tried commenting out public function getResolvedName($namespaceDefinition = null) {
// Name resolution not applicable to constructs that define symbol names or aliases.
if (($this->parent instanceof Node\Statement\NamespaceDefinition && $this->parent->name->getStartPosition() === $this->getStartPosition()) ||
$this->parent instanceof Node\Statement\NamespaceUseDeclaration ||
$this->parent instanceof Node\NamespaceUseClause ||
$this->parent instanceof Node\NamespaceUseGroupClause ||
/*$this->parent->parent instanceof Node\TraitUseClause ||*/
$this->parent instanceof Node\TraitSelectOrAliasClause
) {
return null;
} I have not yet managed to wrap my head around |
I cannot figure out why @mousetraps prohibited this. Even the other case of class TestClazz
{
use TestTrait {
TestTrait::test2 as testX;
} Gets constructed into: And such Then again it still does not make sense to have this as even here the (unless I'm missing something) Making a PR. |
When I need to resolve the FQN of the
use TestTrait
I cannot use the handy getResolvedName. Why is that?https://github.com/microsoft/tolerant-php-parser/blame/84ce745a39619b10734c8e6b736e055b9fa64d13/src/Node/QualifiedName.php#L88
Thanks!
The text was updated successfully, but these errors were encountered: