From 2758a2e95a2c63b1294560ae2d72b73195fac8c9 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Wed, 1 Jan 2025 04:21:20 +0100 Subject: [PATCH] SemanticAnalysis.hpp: Re-add checking for redefinitions of constants Signed-off-by: Username404-59 --- src/headers/SemanticAnalysis.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/headers/SemanticAnalysis.hpp b/src/headers/SemanticAnalysis.hpp index d1feadb..23062dc 100644 --- a/src/headers/SemanticAnalysis.hpp +++ b/src/headers/SemanticAnalysis.hpp @@ -46,6 +46,11 @@ private: ), share_task(Function, Class), share_task(Function, Define), + make_nonlocal_task(Define, + if (parsedTree.findReferenceByName>(parseComponent.name).has_value()) { + error(parseComponent.name + string(" cannot be redefined as it is final"), parseComponent.line); + } + ) }; }; };