Closed jamesdettmartin closed 1 month ago
A workaround would be to add your own stub for that method with mixed
removed. The template can't be prioritised over mixed
as mixed
is the super type in the union. 1.10.4 may not have collapsed redundant types as eagerly which is why it worked differently. I'll see if the previous behaviour can be reinstated but the real problem is typing something as mixed|T
defeats the purpose of using templates.
Describe the bug When a method is described to
@return mixed|T
, it is always being interpreted as mixed instead of the class-string being passed in, not providing autocomplete. This was working previously, as many projects I'm working on utilize php-di and theget
method was consistently giving me the class passed in, providing useful autocompletes. Within the past month, it stopped working and now every variable from the container is detected as "mixed" and nullifies the benefits of Intelephense's autocomplete features. This is working as intended in the 1.10.4 versionTo Reproduce
Expected behavior The variable should be detected as the template class for autocompletes
Screenshots 1.12.4 1.10.4
Platform and version WSL: Ubuntu-20.04, Intelephense 1.12.4