DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
B1002: name declared twice
Catalog status: active. Default severity: error. Stable name: duplicate-declaration. Family: Names and declarations.
A declarative region cannot declare two things with the same name, except subprograms and enumeration literals that differ in their profiles (overloading). Later uses of the name keep meaning the first declaration.
Example (Vada)
Count : Integer := 0;
Count : Natural := 1;Example (Varc)
var count: Integer = 0;
var count: Natural = 1;
What to do
Rename one of them, or remove the duplicate.
Regression source and further reading
Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.
See names and declarations, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.