From f2671ffe1785754f0e73d148635cbb38e673e169 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 25 Apr 2023 19:37:22 -0400 Subject: allow redefinition of functions across match arms (#772) --- pyflakes/test/test_match.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pyflakes/test') diff --git a/pyflakes/test/test_match.py b/pyflakes/test/test_match.py index 89826e3..b237523 100644 --- a/pyflakes/test/test_match.py +++ b/pyflakes/test/test_match.py @@ -81,3 +81,14 @@ class TestMatch(TestCase): case {'foo': k1, **rest}: print(f'{k1=} {rest=}') ''') + + def test_defined_in_different_branches(self): + self.flakes(''' + def f(x): + match x: + case 1: + def y(): pass + case _: + def y(): print(1) + return y + ''') -- cgit v1.2.1