Constants declared in functions actually reside in global scope:
def foo()
const i = 1;
print(i);
end;
foo();
i = 2;
produces an error: Assignment to constant or parameter 'i' not allowed..
Originally, constants weren't meant to be created in functions, but with a planned addition of const function parameters of inline functions, it does make sense to allow that. The bug will be fixed by creating the constants properly in the local scope.
Constants declared in functions actually reside in global scope:
produces an error:
Assignment to constant or parameter 'i' not allowed..Originally, constants weren't meant to be created in functions, but with a planned addition of
constfunction parameters of inline functions, it does make sense to allow that. The bug will be fixed by creating the constants properly in the local scope.