[syntax-errors] Detect duplicate keys in match mapping patterns (#17129)

Summary
--

Detects duplicate literals in `match` mapping keys.

This PR also adds a `source` method to `SemanticSyntaxContext` to
display the duplicated key in the error message by slicing out its
range.

Test Plan
--

New inline tests.
This commit is contained in:
Brent Westbrook 2025-04-03 10:22:37 -04:00 committed by GitHub
parent ca0cce3f9c
commit 6e2b8f9696
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 1298 additions and 6 deletions

View file

@ -0,0 +1,2 @@
match x:
case {x.a: 1, x.a: 2}: ...