Files
tsgo/testdata/baselines/reference/compiler/regexNamedGroupDuplicateNestedInGroup.symbols
8ffb4ef78a Fix TS1515 not reported when duplicate named group is nested inside a group (#4881)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: RyanCavanaugh <[email protected]>
Co-authored-by: Ryan Cavanaugh <[email protected]>
2026-08-14 19:47:55 +00:00

26 lines
776 B
Plaintext

//// [tests/cases/compiler/regexNamedGroupDuplicateNestedInGroup.ts] ////
=== regexNamedGroupDuplicateNestedInGroup.ts ===
// Duplicate at the top level (already reported prior to this fix).
/(?<a>x)(?<a>y)/;
// Earlier definition nested inside a non-capturing group.
/(?:(?<a>x))(?<a>z)/;
// Earlier definition nested inside a non-capturing group with alternation.
/(?:(?<a>x)|y)(?<a>z)/;
// Earlier definition nested inside a lookahead assertion.
/(?=(?<a>x))(?<a>z)/;
// Earlier definition nested inside a capturing group.
/((?<a>x))(?<a>z)/;
// Legal: duplicate names in different alternatives of the same disjunction.
/(?<a>x)|(?<a>y)/;
// Legal: duplicate names in different alternatives of a nested disjunction.
/(?:(?<a>x)|(?<a>y))/;