Skip to content
Discussion options

You must be logged in to vote

This is invalid because you could have Qux extends Baz and it would inherit the method returning self, so it would not return static as required. You can either mark Baz as final to rule out this possibility, or use @psalm-consistent-constructor and have the method construct static instead of self.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@M1ke
Comment options

Answer selected by M1ke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants