diff --git a/src/headers/transpiler/implementations/GodotScript.hpp b/src/headers/transpiler/implementations/GodotScript.hpp index deb432c..363796d 100644 --- a/src/headers/transpiler/implementations/GodotScript.hpp +++ b/src/headers/transpiler/implementations/GodotScript.hpp @@ -9,7 +9,9 @@ struct GsTarget: Target { make_task(Define, const optional previous = parsedTree.findReferenceByName>(parseComponent.name); if (previous.has_value() and &previous.value().get() == &parseComponent) { // TODO Recursively traverse the parsedTree's parents and their parents to find existing definitions and do it in semantic analysis - output << (parseComponent.final ? "const " : "var "); + output << "var "; + } else if (parseComponent.final) { + output << "const "; } output << parseComponent.name << " = "; transpileTree(parseComponent.content);