You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
cardillan
changed the title
Unclear precedence of user-defined functions
Inconsistent precedence of user-defined functions
Jan 21, 2025
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:
produces
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.
The text was updated successfully, but these errors were encountered: