Implicit initialization of a structure as an array does not work.
Reported by Samuel GOUGEON (@sgougeon)
-- Bug description --
Implicit initialization of a structure as an array does not work.
-- Scilab error message --
-->clear S
-->S(1:2,1:3).a="abc"
!--error 8
Addition incohérente.
at line 23 of function sub2ind called by :
at line 47 of function createstruct called by :
at line 24 of function %c_i_s called by :
S(1:2,1:3).a="abc"
-->clear S
-->S.a="abc"
S =
a: "abc"
// So, it is possible to initialize a structure without struct(), but not an array-structure. Whether it is a feature, the error message is not clear at all.
-->S(1:2,1:3).a="abc"
S =
2x3 struct array with fields:
a
-->S(5).a
ans =
abc
-- How to reproduce the bug --
clear S
S(1:2,1:3).a="abc"
clear S
S.a="abc"
S(1:2,1:3).a="abc"
S(5).a