Static return type and inheritance #4795
Answered
by
dktapps
kralmichal
asked this question in
Support
-
Hi, I have question about static type and inheritance. In the simplified example below, for phpstan there is difference between static(ConcreteDTO) and ConcreteDTO. Is this a expected behaviour? https://phpstan.org/r/3d5abb5c-7eba-462f-940c-839b36cfbe61 Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
dktapps
Apr 2, 2021
Replies: 1 comment 2 replies
-
This looks like a problem with the handling of the native You should probably report a bug. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ondrejmirtes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This looks like a problem with the handling of the native
static
return type. If you replace it with@return static
, it works correctly: https://phpstan.org/r/96e3eb5b-dea4-499b-949c-5d8fc99d6db2You should probably report a bug.