In if/while conditions, the empty sparse boolean is considered as TRUE.
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
The introduction of empty sparse and empty sparse boolean in Scilab 6.1.0 sets some issues.
In if/while conditions,
- [] and sparse([]) are considered as %F // OK
- The empty sparse boolean is considered as %T: THE BUG
Illustration:
--> if [], disp("I am true"), end // OK
-->
--> if sparse([]), disp("hello world"), end // Still OK
-->
BUT
--> a = sparse(1)<2; a(1)=[]
a =
( 0, 0)empty sparse boolean matrix
--> if a, disp("I am true"), end // KO
"I am true"
-->
ERROR LOG:
----------
None. Wrong behavior
HOW TO REPRODUCE THE BUG:
-------------------------
a = sparse(1)<2; a(1) = [];
b = 1;
if a, b = 2; end
b == 1 // %T expected
OTHER INFORMATION:
------------------
See also the bug 16348 and the bug 16349