Open
Description
Current problem
The match
keyword is prone to the following misunderstanding that pylint fails to catch:
a = 'a'
b = 'b'
s = 'a'
match s:
case a:
pass
case b:
pass
It's easy to see this as a correct case statement construct, but Python will actually interpret this as a capture pattern instead of the desired value pattern and respond with SyntaxError: name capture 'a' makes remaining patterns unreachable
. Pylint fails to catch this.
Desired solution
There should be an error reported on the 6th line.
Additional context
I'm new to pylint so please correct me if this case is already handled.