GREL string concatentation (+) overly aggressive #6341
Labels
grel
The default expression language, GREL, could be improved in many ways!
Priority: Low
Indicates less critical issues that can be dealt with at a later stage
Type: Bug
Issues related to software defects or unexpected behavior, which require resolution.
Milestone
Currently the string concatenation operator (+) is used in cases where it isn't appropriate so that, for example
"1/1/1990".toDate() + 1
converts the values to strings and concatenates them, which is almost certainly not what the user expects.Current Results
The binary addition operator (+) results in string concatenation when used with anything except two numbers which is overly greedy behavior.
Expected Behavior
String concatenation should be limited to cases where at least one operand is a string. Unsupported cases (e.g. date + integer) should be an error (which just returns
null
in current GREL conventions).The text was updated successfully, but these errors were encountered: