Reading the language reference, I’m not sure if an implicit cast of an UNSIGNED to a BOOLEAN is expected or not (not sure what the highlighted section below was meaning to convey):
During expression evaluation, different value types may be implicitly cast in order to properly evaluate the expression. Implicit casting always means promoting one value type to another: INTEGER to STRING or INTEGER to REAL. BOOLEAN types may not be involved in mixed mode expressions.
I was looking at an issue recently, and the code effectively was written like this (simplified example):
Somefunc(STRING str, BOOLEAN isConfirmed = FALSE, UNSIGNED seq = 1) := FUNCTION
s := str + seq;
c := IF(isConfirmed, 'CONFIRMED: ', 'NOT CONFIRMED: ');
RETURN c + s;
The calling code was not correctly aligned with the function parameters:
Foo := Somefunc(‘bar’, 8);
This produced no warning, but didn’t function the way the developer intended.
If there is concern that changing this behavior would break a lot of existing code, it would at least be beneficial for this to generate a warning.