Open NicoLaval opened 6 months ago
The example i have tested is from the BdI testcases is the one under "11. conditional/if-then-else_2".
The following statement has been failing:
result:= d1[calc Me_2 := if (Id_4 = "F") then Me_1/1000 else 0];
Bug approved. Thanks.
Isn't it a type problem? I think this should work:
result:= d1[calc Me_2 := if (Id_4 = "F") then Me_1/1000 else 0.0];
(note the 0.0 instead of 0)
The error message could be better, the function not found is misleading in this case.
@hadrienk you are right, thank you. With the 0.0 it is working.
Sure it works but as we have done in ComparisonVisitor, we have to support this mixt of number and integer, instead of asking to the user to write a tricky 0.0
Would be nice if also a mix of other data types e.g. with null is supported.
result:= d1[calc Me_2 := if (Id_4 = "F") then Me_1/1000 else null];
is also quite useful out of our point of view.
What's about:
result:= d1[calc Me_2 := if (Id_4 = "F") then Me_1/1000 else cast(null, number)];
?
I think the actual specification doesn't define null type inference, maybe it could be defined and then handled.
Thank you!
@noahboerger you reported
If-then-else
is not supported.I thought it was, for scalars, components and datasets.
Could you report a failed example please?