Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Components
Assignee
Gavin HallidayGavin HallidayReporter
Kevin LogemannKevin LogemannPriority
MajorFix versions
Labels
Affects versions
Details
Details
Components
Assignee
Gavin Halliday
Gavin HallidayReporter
Kevin Logemann
Kevin LogemannPriority
Fix versions
Labels
Affects versions
Created January 6, 2020 at 2:22 PM
Updated January 10, 2020 at 11:11 AM
Resolved January 10, 2020 at 11:11 AM
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;
END;
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.
@Gavin Halliday