bugGNU Octave - Bugs: bug #60768, Error creating an array from a...

 
 

bug #60768: Error creating an array from a list of objects

Submitter:  Fernando <tutissanalio>
Submitted:  Thu 10 Jun 2021 05:52:53 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 11 Jun 2021 07:27:05 AM UTC, comment #2: 

Many thanks.

Fernando <tutissanalio>
Thu 10 Jun 2021 06:04:48 PM UTC, comment #1: 

Closing as a duplicate of bug #44665.

It was also reported as bug #53906 where a workaround was suggested that may help you until the problem is fixed.

John W. Eaton <jwe>
Group administrator
Thu 10 Jun 2021 05:52:53 PM UTC, original submission:  

I created a simple class like the following


classdef MyClass < handle
  properties
    data=0;
  end
  methods
    function obj=MyClass(data)
      obj.data=data;
    end
  end
end


Then, in octave, I cannot construct an array with two objects of the class in this way:

>> a=MyClass(1);
>> x=[a,a]
warning: struct: converting a classdef object into a struct overrides the access restrictions defined for properties. All properties are returned, including private and protected ones.
warning: struct: converting a classdef object into a struct overrides the access restrictions defined for properties. All properties are returned, including private and protected ones.
error: octave_base_value::parent_class_name_list(): wrong type argument 'object'


The same sentences work without any problem in Matlab:

>> a=MyClass(1);
>> x=[a,a]
x =
  1×2 MyClass array with properties:
    data


Note that the following works in octave (and Matlab):

>> x(1)=a;
>> x(2)=a;
>> x
x =
  MyClass object array with properties:
      data
>>  size(x)
ans =
   1   2


Fernando <tutissanalio>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by tutissanalio (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-18 rik5 Dependencies- Depends on bugs #65179
    2021-06-10 jwe StatusNone Duplicate
        Open/ClosedOpen Closed
        Release6.2.90 dev

    Back to the top

    Powered by Savane 3.13-0329.
    Corresponding source code