VBC09319 — Duplicate label definition
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
A procedure body defines the same line label or line number more than once. A procedure declaration must contain exactly one definition of each label value it declares (MS-VBAL §5.4.1.1 Statement Labels).
This code is raised by instruction-list lowering (RD-VBAL §3.5.3 Lowering Block Statements), which builds the label table a jump statement's target resolves against. Lowering needs every label to resolve to a single, unambiguous offset.
The verbose detail names the label that was defined more than once.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
| The same identifier labels two different statements in one procedure. | Top: ... Top: |
Rename one of the labels, or remove the duplicate. |
| The same line number labels two different statements in one procedure. | 100: ... 100: |
Renumber one of the lines, or remove the duplicate. |
| Two labels differing only by case. | Top: ... TOP: |
Label names are not case-sensitive: this is the same label defined twice. |
Notes
Only the first definition of a repeated label is kept: it is the one every jump to that label resolves against.
A label that a jump names but that the procedure does not define at all is a different condition, VBC09309, and is not reported by this code.
See also
- RD-VBAL §2.6.2 Semantic Compilation Errors
- RD-VBAL §3.5.3 Lowering Block Statements
- RD-VBAL §5.4.1.1 Statement Labels
⏮️ VBC09315 Exit Property not allowed in Sub or Function | ⏭️ VBC09320 Inconsistent property accessors
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca