bugGNU Octave - Bugs: bug #55774, Subsasign on class member: a...

 
 

bug #55774: Subsasign on class member: a cs-list cannot be further indexed

Submitter:  None
Submitted:  Sun 24 Feb 2019 12:06:03 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Jonas Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 5.1.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 09 Mar 2019 03:59:01 PM UTC, comment #3: 

This issue may be because numel is being called inappropriately.

I used a modified version of the A class below.


classdef A < handle
  properties
    list
  end
  methods
    function self = A()
      self.list = {1,2};
    end
    function r = numel (self)
      keyboard;
      r = numel (self.list);
    end
  end
end


Then I executed


a = A();
a.list(3) = 4;


What happens next is that the numel() function for the A class is called and I hit the keyboard statement.  This does not appear to be correct.  If the interpreter was validating that the index 3 is okay it needs to call numel on (a.list) which is a cell array.  Instead, it seems that it may be checking that numel (a).


Rik <rik5>
Group administrator
Sun 24 Feb 2019 08:35:18 PM UTC, comment #2: 

I can confirm that it:

  • fails in 5.0.91
  • works in matlab r2019a:


>> a = A()
a =
  A with properties:

    list: {[1]  [2]}
>> a.list{end+1} = 4
a =
  A with properties:

    list: {[1]  [2]  [4]}


Philip Nienhuis <philipnienhuis>
Group Member
Sun 24 Feb 2019 12:13:03 PM UTC, comment #1: 

and A defines numel that returns a value > 1

classdef A < handle
  properties
    list
  end
  methods
    function self = A()
      self.list = {1,2};
    end
    function r = numel(self)
      r = 2;
    end
  end
end


Anonymous
Sun 24 Feb 2019 12:06:03 PM UTC, original submission:  

Assuming that class A has a member list which is a cell array


a = A();
a.list{end+1} = 4

error: a cs-list cannot be further indexed




Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by None (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-09 rik5 Carbon-Copy- Added jwe
    2019-02-26 mtmiller CategoryNone Interpreter
        Severity3 - Normal 2 - Minor
        Item GroupNone Matlab Compatibility
        Release5.0.91 5.1.0
        Operating SystemMicrosoft Windows Any
    2019-02-24 philipnienhuis StatusNone Confirmed
        Release4.4.0 5.0.91

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code