Files
openide/python/testData/highlighting/patternBindsNameMultipleTimes.py
Mikhail Golubev e9d11d1215 PY-48010 Warn about problems causing SyntaxErrors in PEP 634 patterns
GitOrigin-RevId: 718645cc5dfd6d0a14f1bd802f3c5bb2bb2c6074
2021-10-18 13:57:02 +00:00

16 lines
915 B
Python

match 42:
case x, <error descr="Name 'x' is already bound">x</error>:
pass
case x, (1 as <error descr="Name 'x' is already bound">x</error>) | (2 as <error descr="Name 'x' is already bound">x</error>):
pass
case [(1 as x) | (2 as x), <error descr="Name 'x' is already bound">x</error>]:
pass
case [(1 as x) | (2 as x), (1 as <error descr="Name 'x' is already bound">x</error>) | (2 as <error descr="Name 'x' is already bound">x</error>)]:
pass
case ((1 as x) | (2 as x)) | (3 as x):
pass
case x, ((1 as <error descr="Name 'x' is already bound">x</error>) | (2 as <error descr="Name 'x' is already bound">x</error>)) | (3 as <error descr="Name 'x' is already bound">x</error>):
pass
case (x, (1 as <error descr="Name 'x' is already bound">x</error>) | (2 as <error descr="Name 'x' is already bound">x</error>)) | (3 as x):
pass