Asama 3.4 — Report duplicate definition errors #48

Open
opened 2026-05-26 19:52:15 +03:00 by saqut · 0 comments
Owner

Goal: When a symbol is defined twice in the same scope, report an error.

Files to modify:

  • src/symbol/symbol_table.hpp
  • src/symbol/symbol_collector.hpp

Requirements:

  • SymbolTable::define() returns false on duplicate; collector emits diagnostic.
  • Error message includes location of previous definition.
  • Works for variables, functions, structs.
  • Shadowing in nested scopes is allowed (not an error).

Success criteria:

  • Two int main() definitions produce an error.
  • Two int x in the same block produce an error.
**Goal:** When a symbol is defined twice in the same scope, report an error. **Files to modify:** - src/symbol/symbol_table.hpp - src/symbol/symbol_collector.hpp **Requirements:** - SymbolTable::define() returns false on duplicate; collector emits diagnostic. - Error message includes location of previous definition. - Works for variables, functions, structs. - Shadowing in nested scopes is allowed (not an error). **Success criteria:** - Two int main() definitions produce an error. - Two int x in the same block produce an error.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: saqut/saqut-compiler#48
No description provided.