[Bugzilla] [Bug 15497] New: Structures containing lists with 1 element : wrong type with syntax: structure("field")

bugzilla.admin at scilab.org bugzilla.admin at scilab.org
Tue Mar 20 15:52:22 CET 2018


http://bugzilla.scilab.org/show_bug.cgi?id=15497
--------- Bug Summary -----------
Structures containing lists with 1 element : wrong type with syntax: structure("field")

---------- Changed by ------------
Alain.Lamy at cnes.fr

---------- What changed ----------
bug_id, short_desc, product, version, rep_platform, op_sys, bug_status, bug_severity, priority, component, assigned_to, reporter


            Bug ID: 15497
           Summary: Structures containing lists with 1 element : wrong
                    type with syntax: structure("field")
           Product: Scilab software
           Version: 6.0.1
          Hardware: (not used)
                OS: All OS
            Status: NEW
          Severity: Critical
          Priority: (field not used)
         Component: Scilab
          Assignee: bugzilla.admin at scilab.org
          Reporter: Alain.Lamy at cnes.fr

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

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/bugzilla/attachments/20180320/845ddc03/attachment.htm>


More information about the Bugzilla mailing list