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

Iterable may contain generators #7599

Open
weirdan opened this issue Feb 7, 2022 · 1 comment
Open

Iterable may contain generators #7599

weirdan opened this issue Feb 7, 2022 · 1 comment

Comments

@weirdan
Copy link
Collaborator

weirdan commented Feb 7, 2022

https://psalm.dev/r/fc0010feb2
Expected: no issues, any iterable can be a generator

Introduced in 4c65d3b

Reported in #7596

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/fc0010feb2
<?php

/**
 * @param iterable<int, string> $i
 */
function f(iterable $i): void {
    if ($i instanceof Generator) {}
}
Psalm output (using commit 0e5ad62):

ERROR: TypeDoesNotContainType - 7:9 - Cannot resolve types for $i - iterable<int, string> does not contain Generator

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

No branches or pull requests

1 participant