Skip to content

Add test for NotIterable error in starred tuple unpacking#4189

Open
anushamukka-dev wants to merge 1 commit into
facebook:mainfrom
anushamukka-dev:export-D112538198
Open

Add test for NotIterable error in starred tuple unpacking#4189
anushamukka-dev wants to merge 1 commit into
facebook:mainfrom
anushamukka-dev:export-D112538198

Conversation

@anushamukka-dev

Copy link
Copy Markdown
Contributor

Summary:
The error path in expr.rs that reports Expected an iterable, got ...
when a non-iterable type is used with star (*) unpacking in a tuple
display (e.g. (*x,)) carried a // TODO: missing test marker and had no
dedicated test coverage.

This adds test_unpack_starred_not_iterable_in_tuple, which unpacks an int
into a tuple display and expects the NotIterable error, and removes the
now-resolved TODO comment.

Differential Revision: D112538198

Summary:
The error path in `expr.rs` that reports `Expected an iterable, got ...`
when a non-iterable type is used with star (`*`) unpacking in a tuple
display (e.g. `(*x,)`) carried a `// TODO: missing test` marker and had no
dedicated test coverage.

This adds `test_unpack_starred_not_iterable_in_tuple`, which unpacks an `int`
into a tuple display and expects the `NotIterable` error, and removes the
now-resolved TODO comment.

Differential Revision: D112538198
@meta-cla meta-cla Bot added the cla signed label Jul 17, 2026
@meta-codesync

meta-codesync Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@anushamukka-dev has exported this pull request. If you are a Meta employee, you can view the originating Diff in D112538198.

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant