- Error
- Reported by the binder
TS1114
Duplicate label '{0}'.
Two nested statements use the same label. Give the inner one a different label.
What it means
A label names a loop or block so break and continue can target it. A label can't be reused for a statement nested inside another statement with the same label, since break outer would be ambiguous.
Example
outer: for (;;) {
outer: for (;;) { break outer; }
}
export {};
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(2,3): error TS1114: Duplicate label 'outer'.
Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.
How to fix
- Rename the inner label (
inner:) and update thebreakorcontinuestatements that use it.