Skip to content

Commit ca25497

Browse files
Add regression test for #5288 (#8385)
1 parent b4fe93a commit ca25497

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fix various false positives for functions that return directly from
2+
structural pattern matching cases.
3+
4+
Closes #5288
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Test returns from structural pattern matching cases."""
2+
3+
def unpack(num) -> tuple[int, int]:
4+
"""Return a tuple of integers."""
5+
match num:
6+
case 1:
7+
return 1, 1
8+
case _:
9+
return 0, 0
10+
11+
x, y = unpack(1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[testoptions]
2+
min_pyver=3.10

0 commit comments

Comments
 (0)