Open mr-feek opened 3 years ago
I found these snippets:
I think it should be consistent with @return
: https://psalm.dev/r/cba0b4b5a3, i.e. trust the docblock but emit MismatchingDocblock issue
I found these snippets:
I think this is a duplicate of https://github.com/vimeo/psalm/issues/5786
We don't have any inheritance here, so the only possible developer intent is to clarify native return type. This makes it very clear that contradiction is a different problem to LSP violations that linked ticket discusses.
https://psalm.dev/r/af5065a4c0
Given that
bar
has a native return type ofstring
, shouldn't psalm be able to emit an error that the phpdoc is invalid? I'm thinking that phpdoc should only become the source of truth if there are no native typehints or the typehints are castable to each other..