Structures containing lists with 1 element : wrong type with syntax: structure("field")
Reported by Alain Lamy
BUG DESCRIPTION:
----------------
Major problem with Scilab 6.0.0 or Scilab 6.0.1 :
If s is a structure that constains fields of type "list":
s("a") and s.a (or getfield("a", s)) are different if the number of elements in the list is 1
See example.
ERROR LOG:
----------
None.
Wrong behaviour.
HOW TO REPRODUCE THE BUG:
-------------------------
s = struct("a", list(1,2), "b", list(3));
--> s
s =
a: list
b: list
--> typeof(s.a)
ans =
list
// OK
--> typeof(s.b)
ans =
list
// OK
--> typeof(getfield("a", s))
ans =
list
// OK
--> typeof(getfield("b", s))
ans =
list
// OK
--> typeof(s("a"))
ans =
list
// OK
--> typeof(s("b"))
ans =
constant
// *** NOT OK ***
OTHER INFORMATION:
------------------
OK with Scilab 5