Skip to content

Attribute type not recognized when retrieved by ReflectionClass->getAttributes #3718

Description

@nalka0

Describe the bug
Attribute type is not recognized when retrieved by ReflectionClass->getAttributes

To Reproduce

$reflected = new ReflectionClass(ReflectionClass::class);
$attributes = $reflected->getAttributes(Override::class);

Expected behavior
VS Code recognizes $attributes as ReflectionAttribute<object>[] instead of ReflectionAttribute<Override>[].
This is most likely caused by both ReflectionClass and getAttributes templates being named T (so it defaults to ReflectionClass' template, instead of getAttributes' template)

Platform and version
Windows 11, intelephense version 1.18.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions