Calls to magic __invoke()
method do not always resolve return type templates
#3102
Labels
__invoke()
method do not always resolve return type templates
#3102
Describe the bug
When a class
__invoke()
method is hinted to return a type that includes class-level template types (e.g.@returns T[]
), the inferred type for return values will not have the template types resolved to concrete types.Interestingly, this behavior is not reproducible if:
@return T
),__invoke()
method is called explicitly on the object.To Reproduce
Expected behavior
Since the LSP is aware that the object is a
Bug
, I would also expect the return value's template types to be resolved to concrete types using the invoked object as context (which in this case isBug<DateTime>
).Platform and version
Arch Linux, kernel v6.10.10
Intelephense v1.12.6 (Neovim)
The text was updated successfully, but these errors were encountered: