bugGNU Octave - Bugs: bug #44665, Cannot create object array using...

 
 

bug #44665: Cannot create object array using bracket syntax

Submitter:  -X- <jsh>
Submitted:  Mon 30 Mar 2015 06:40:35 AM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 30 Jan 2024 10:09:46 PM UTC, comment #4: 

This is related to bug #65179 and the creation of arrays of classdef objects.  Making this report dependent on bug #65179.

Rik <rik5>
Group administrator
Sun 07 Jun 2020 10:21:21 AM UTC, comment #3: 

This still isn't supported on current dev:

> a = [foo; foo];
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: invalid conversion of multi-dimensional struct to scalar struct


Markus Mützel <mmuetzel>
Group administrator
Thu 21 Apr 2016 04:02:04 PM UTC, comment #2: 

The error message is now:


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'


A way around is:


a(1) = foo();
a(2) = foo()
a =

<object array foo>


Guillaume <gyom>
Tue 02 Jun 2015 04:43:24 PM UTC, comment #1: 

Retagging release from 4.0.0-rc2 to 4.0.0.

John W. Eaton <jwe>
Group administrator
Mon 30 Mar 2015 06:40:35 AM UTC, original submission:  

Concatenation of classdef objects fail with the error messages:

error: invalid conversion of multi-dimensional struct to scalar struct
error: octave_base_value::parent_class_name_list(): wrong type argument 'object'

It seems at least one part of the problem are the '__parent_classes__' and 'parent_class_names' functions which do not seem to support classdef objects.

To test, create a class, for example:


classdef foo
  properties
    bar = 1;
  end
end


and try to concatenate some instances:


a = foo();
[ a a ]
__parent_classes__(a)


If this isn't supported yet maybe a better error message should be printed instead.

-X- <jsh>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by amro_octave
  • -email is unavailable- added by gyom (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jsh (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-30 rik5 Summaryerror in concatenation of classdef objects Cannot create object array using bracket syntax
        Dependencies- Depends on bugs #65179
    2024-01-23 mmuetzel CategoryInterpreter Classdef
    2024-01-18 rik5 Dependencies- bugs #56323 is dependent
    2020-06-07 mmuetzel Item GroupNone Feature Request
        StatusNone Confirmed
        Release4.0.0 dev
    2019-05-09 siko1056 Dependencies- bugs #53906 is dependent
    2016-12-09 amro_octave Carbon-Copy- Added amro_octave
    2015-06-02 jwe Release4.0.0-rc2 4.0.0

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code