Repository navigation
Conversation
staabm
left a comment
There was a problem hiding this comment.
only one of the reproducers of the referenced issue is fixed. therefore this PR does not close the issue.
|
|
||
| declare(strict_types = 1); | ||
|
|
||
| namespace Bug11507; |
There was a problem hiding this comment.
it seems this snippet was adopted and does not reflect 1:1 the reported reproducer of phpstan/phpstan#11507 (comment) ?
There was a problem hiding this comment.
which of the snippets in the referenced issue contains this code-example. I was not able to find it. it still looks like it was adopted
There was a problem hiding this comment.
I think it is the snippet from the opening description. Although I don't think that it passes yet anyway. I suspect (haven't investigated) that as a result, the test in question isn't behaving as intended?
Incase it saves anyone any time, the comment at the end of my issue reporting that 2.3.x now has a different report was for another snippet (which does now pass).
291aff8 to
278e88b
Compare
|
Thanks @staabm, you're right. I changed |
Adds a regression test for #11507, reported by @liamduckett. The reproducer from the issue (a
Collection::map()callback that sets$item['foo']on anon-empty-array<string, string>) no longer reports "Function foo() should return Collection<int, non-empty-array<string, string>> but returns Collection<int, non-empty-array<string, string>>" since the bidirectional type narrowing work landed in 2.3.x. The test fails on 2.2.17 with exactly that error and passes on 2.3.x.Refs phpstan/phpstan#11507 (covers the first reproducer only; the simpler one from the comments still reports the error)