Files
tsgo/testdata/baselines/reference/compiler/regexNamedGroupDuplicateNestedInGroup.errors.txt
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

39 lines
2.1 KiB
Plaintext

regexNamedGroupDuplicateNestedInGroup.ts(2,12): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
regexNamedGroupDuplicateNestedInGroup.ts(5,16): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
regexNamedGroupDuplicateNestedInGroup.ts(8,18): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
regexNamedGroupDuplicateNestedInGroup.ts(11,16): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
regexNamedGroupDuplicateNestedInGroup.ts(14,14): error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
==== regexNamedGroupDuplicateNestedInGroup.ts (5 errors) ====
// Duplicate at the top level (already reported prior to this fix).
/(?<a>x)(?<a>y)/;
~
!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
// Earlier definition nested inside a non-capturing group.
/(?:(?<a>x))(?<a>z)/;
~
!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
// Earlier definition nested inside a non-capturing group with alternation.
/(?:(?<a>x)|y)(?<a>z)/;
~
!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
// Earlier definition nested inside a lookahead assertion.
/(?=(?<a>x))(?<a>z)/;
~
!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
// Earlier definition nested inside a capturing group.
/((?<a>x))(?<a>z)/;
~
!!! error TS1515: Named capturing groups with the same name must be mutually exclusive to each other.
// 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))/;