Skip to content

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Oct 18, 2022

I did not change behaviour on purpose, but was wondering why the handling of ArrayType and ConstantArrayType is different for keys that cannot be casted to string. And also why we return a NeverType instead of a ErrorType 🤔
e.g. things that cannot be casted to a string will make it fail hard https://3v4l.org/gBHIk

@herndlm
Copy link
Contributor Author

herndlm commented Oct 18, 2022

added a second commit that makes it return *ERROR* consistently

@herndlm herndlm force-pushed the array-fill-keys branch 3 times, most recently from 0fa67a2 to bdb63cf Compare October 18, 2022 20:42
@herndlm
Copy link
Contributor Author

herndlm commented Oct 18, 2022

hmm, weird the tests were a bit flaky here and I had to force-push multiple times. saw random-looking timeouts, but also once the following error in-between for example

Ignored error pattern #^Call to an undefined method TestResultCache1\Foo::doFoo().$# in path /home/runner/work/phpstan-src/phpstan-src/e2e/result-cache-1/src/Baz.php was not matched in reported errors.

@ondrejmirtes
Copy link
Member

Yes, it's a mystery for me too: https://github.com/orgs/community/discussions/36656

@ondrejmirtes ondrejmirtes merged commit 8b1110b into phpstan:1.9.x Oct 21, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@herndlm herndlm deleted the array-fill-keys branch October 21, 2022 07:31
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