Document undesirable generator expression behavior in test and fix one case #20594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a test case to explicitly demonstrate behavior which I believe has the same root cause as #18026
The short explanation is that if any get produced while inferring the type of a generator expression which is being passed to an overloaded function, the overload will be considered failed, even if the error has no effect on the inferred type of the generator expression.
One experiment to try that might address this could be to only fail the overload if the inferred type contains
AnyType(TypeOfAny.from_error).For now, only fix the specific case where the "error" is a
reveal_typenote.