You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... rest of code
[, $enum2] = HelperFunc::MethodThatReturnsEnums($aggregation);
return [$enum2->value, $enum2->enumMethod($arg)];
... rest of code
In this example code MethodThatReturnsEnums returns a tuple of values with two different enum types.
[E1, E2].
in the above $enum2 actually has the type of E1 according to phpactor, when in reality it is of enum E2, the end result is that when we call $enum2->enumMethod($arg), it's displaying an error as enumMethod doesn't exist on E1 (which is correct).
Hi,
I'm noticing an issue with the following.
In this example code MethodThatReturnsEnums returns a tuple of values with two different enum types.
[E1, E2].
in the above $enum2 actually has the type of E1 according to phpactor, when in reality it is of enum E2, the end result is that when we call $enum2->enumMethod($arg), it's displaying an error as enumMethod doesn't exist on E1 (which is correct).
[$_, $enum2] = HelperFunc::MethodThatReturnsEnums($aggregation);
if I then update the code like so, everything gets typed correctly ($enum2 is of type E2) and the incorrect errors go away.
For reference this issue does not take place on PhpStorm, but it does also display with Intelephense.
If I can provide any other info please let me know.
The text was updated successfully, but these errors were encountered: