Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array_values on a list isn't marked as a paradox #6988

Closed
danog opened this issue Nov 25, 2021 · 2 comments · Fixed by #6997
Closed

array_values on a list isn't marked as a paradox #6988

danog opened this issue Nov 25, 2021 · 2 comments · Fixed by #6997
Labels
easy problems enhancement Help wanted

Comments

@danog
Copy link
Contributor

danog commented Nov 25, 2021

https://psalm.dev/r/24ce4a0009

@psalm-github-bot
Copy link

psalm-github-bot bot commented Nov 25, 2021

I found these snippets:

https://psalm.dev/r/24ce4a0009
<?php

/**
 * @param list<string> $i
 * @return list<string>
 */
function t(array $i): array {
    return array_values($i);
}
Psalm output (using commit 55b2b6b):

No issues!

@orklah
Copy link
Collaborator

orklah commented Nov 25, 2021

That should be pretty easy to add, we actually do exactly that for strtolower:

if ($first_arg && $function_id === 'strtolower') {

@orklah orklah added easy problems Help wanted labels Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy problems enhancement Help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants