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

AssertionReconciliation: non-empty-list results in list #9917

Closed
boesing opened this issue Jun 13, 2023 · 2 comments · Fixed by #9953
Closed

AssertionReconciliation: non-empty-list results in list #9917

boesing opened this issue Jun 13, 2023 · 2 comments · Fixed by #9953

Comments

@boesing
Copy link
Contributor

boesing commented Jun 13, 2023

When I pass an iterable to an assertion which verifies that I do have a non-empty-list, psalm does not adapt non-empty-list and instead reconciles to list.

https://psalm.dev/r/0441efb80e

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/0441efb80e
<?php

final class WhateverAssert
{
    /** 
     * @psalm-assert non-empty-list $value
     */
	public static function doAssert(mixed $value): void
    {}
}


/** @var iterable<mixed,string> $iterable */
$iterable = [];

WhateverAssert::doAssert($iterable);

/** @psalm-trace $iterable */
Psalm output (using commit 49c6f31):

INFO: Trace - 18:30 - $iterable: list<string>

@boesing
Copy link
Contributor Author

boesing commented Jun 13, 2023

Stopped working with 5.9.0

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 a pull request may close this issue.

1 participant