mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-16 22:58:15 +01:00
Fix NameResolver for class constant native type
This commit is contained in:
parent
d0b35126e7
commit
f66650073c
@ -115,6 +115,9 @@ class NameResolver extends NodeVisitorAbstract {
|
||||
$this->addNamespacedName($const);
|
||||
}
|
||||
} elseif ($node instanceof Stmt\ClassConst) {
|
||||
if (null !== $node->type) {
|
||||
$node->type = $this->resolveType($node->type);
|
||||
}
|
||||
$this->resolveAttrGroups($node);
|
||||
} elseif ($node instanceof Stmt\EnumCase) {
|
||||
$this->resolveAttrGroups($node);
|
||||
|
@ -188,7 +188,7 @@ class A extends B implements C, D {
|
||||
E::h as i;
|
||||
E::j insteadof F, G;
|
||||
}
|
||||
|
||||
|
||||
#[X]
|
||||
public float $php = 7.4;
|
||||
public ?Foo $person;
|
||||
@ -197,6 +197,10 @@ class A extends B implements C, D {
|
||||
|
||||
#[X]
|
||||
const C = 1;
|
||||
|
||||
public const X A = X::Bar;
|
||||
public const X\Foo B = X\Foo::Bar;
|
||||
public const \X\Foo C = \X\Foo::Bar;
|
||||
}
|
||||
|
||||
#[X]
|
||||
@ -262,6 +266,9 @@ class A extends \NS\B implements \NS\C, \NS\D
|
||||
public \NS\A|\NS\B|int $prop;
|
||||
#[\NS\X]
|
||||
const C = 1;
|
||||
public const \NS\X A = \NS\X::Bar;
|
||||
public const \NS\X\Foo B = \NS\X\Foo::Bar;
|
||||
public const \X\Foo C = \X\Foo::Bar;
|
||||
}
|
||||
#[\NS\X]
|
||||
interface A extends \NS\C, \NS\D
|
||||
|
Loading…
x
Reference in New Issue
Block a user