Summary
This file produces an invalid-syntax error, but it contains valid syntax:
import ast
match None:
case ast.Subscript(n, ast.Constant() | ast.Slice()) | ast.Attribute(n):
pass
https://play.ruff.rs/a88bae2d-d65a-4495-a33d-384a09fbbb4f
If I remove | ast.Slice(), the error goes away, so it seems like state is incorrectly shared between different alternative patterns.
Version
ruff 0.14.4