Skip to content

Use TypeUtils::getOldConstantArrays in array_fill_keys extension#1676

Merged
ondrejmirtes merged 2 commits intophpstan:1.8.xfrom
herndlm:array-fill-keys-get-old-constant-arrays
Sep 1, 2022
Merged

Use TypeUtils::getOldConstantArrays in array_fill_keys extension#1676
ondrejmirtes merged 2 commits intophpstan:1.8.xfrom
herndlm:array-fill-keys-get-old-constant-arrays

Conversation

@herndlm
Copy link
Copy Markdown
Contributor

@herndlm herndlm commented Sep 1, 2022

jfyi: an optional key that is not at the end of the array will lead to a union key which will lead to generalization to a generic array via the ConstantArrayBuilder, which makes sense since a union cannot be used as key. this is not changed behaviour but surprised me for a second when I added optional key tests :)

@herndlm herndlm changed the title Array fill keys get old constant arrays Use TypeUtils::getOldConstantArrays in array_shift extension Sep 1, 2022
@herndlm
Copy link
Copy Markdown
Contributor Author

herndlm commented Sep 1, 2022

This time I opened it with the wrong title and forgot to change commit messages. Ondrej, please show mercy :D

@herndlm herndlm changed the title Use TypeUtils::getOldConstantArrays in array_shift extension Use TypeUtils::getOldConstantArrays in array_fill_keys extension Sep 1, 2022
@herndlm herndlm force-pushed the array-fill-keys-get-old-constant-arrays branch from ef73a7e to a39e570 Compare September 1, 2022 08:06
@ondrejmirtes ondrejmirtes merged commit fc69708 into phpstan:1.8.x Sep 1, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@herndlm herndlm deleted the array-fill-keys-get-old-constant-arrays branch September 1, 2022 08:16
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.

2 participants