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); + } + ) }; }; };