Skip to content

Add regression test for #11507 - #6747

Open
HawkForge wants to merge 1 commit into
phpstan:2.3.xfrom
HawkForge:test/bug-11507
Open

HawkForge wants to merge 1 commit into
phpstan:2.3.xfrom
HawkForge:test/bug-11507

Conversation

@HawkForge

Copy link
Copy Markdown
Contributor

Adds a regression test for #11507, reported by @liamduckett. The reproducer from the issue (a Collection::map() callback that sets $item['foo'] on a non-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.

Closes phpstan/phpstan#11507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type mismatch when explicitly setting an array key

1 participant