-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
compilerRelated to the code generatorRelated to the code generator
Description
When a user-defined functions shadows a built-in one, the built-in one is chosen in compile-time expression evaluation, while a user-defined one is chosen to compile non-constant expressions:
param a = 90; // Prevents compile-time evaluation
def sin(x)
x * x;
end;
begin
println(sin(90));
println(sin(a));
printflush(message1);
end;
produces
1
8100
The issue won't be fixed until modules and namespaces are introduced, at which time some mechanism for accessing shadowed built-in functions gets implemented.
The workaround is to avoid functions that shadow existing built-in functions.
Metadata
Metadata
Assignees
Labels
compilerRelated to the code generatorRelated to the code generator