[apps] Add comment about variables that cannot overwrite functions

This commit is contained in:
Léa Saviot
2018-11-07 17:40:23 +01:00
committed by Émilie Feral
parent 8b2c00d8ba
commit 0511f383d0

View File

@@ -103,6 +103,9 @@ const Expression GlobalContext::ExpressionForActualSymbol(const SymbolAbstract &
Ion::Storage::Record::ErrorStatus GlobalContext::SetExpressionForActualSymbol(const Expression & expression, const SymbolAbstract & symbol, Ion::Storage::Record previousRecord) {
if (!previousRecord.isNull() && Ion::Storage::FullNameHasExtension(previousRecord.fullName(), funcExtension, strlen(funcExtension))) {
/* A function can overwrite a variable, but a variable cannot be created if
* it has the same name as an existing function. */
// TODO Pop up "Name taken for a function"
return Ion::Storage::Record::ErrorStatus::NameTaken;
}
// Delete any record with same name (as it is going to be overriden)