bugGNU Octave - Bugs: bug #60726, nargout for {} in subsref() method...

 
 

bug #60726: nargout for {} in subsref() method does not match MATLAB

Submitter:  Ray Zimmerman <rdzman>
Submitted:  Thu 03 Jun 2021 06:55:47 PM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
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
   

Sun 06 Jun 2021 08:10:09 AM UTC, comment #4: 

See bug #48693 for a patch fixing the issue.

Fernando <tutissanalio>
Sat 05 Jun 2021 03:44:21 PM UTC, comment #3: 

After having a closer look, I think this is a duplicate of bug #48693, filed in 2016.

Fernando <tutissanalio>
Fri 04 Jun 2021 05:22:13 PM UTC, comment #2: 

I think this could related to bug #60723 and Matlab's function numArgumentsFromSubscript:

https://www.mathworks.com/help/matlab/ref/numargumentsfromsubscript.html

Fernando <tutissanalio>
Fri 04 Jun 2021 03:48:47 PM UTC, comment #1: 

Same result on development branch of Octave (0,1,0,1).  Marking as Confirmed.

Rik <rik5>
Group administrator
Thu 03 Jun 2021 06:55:47 PM UTC, original submission:  

With the following simple classdef ...


classdef nargout_in_subsref_bug < handle
    properties
        c = num2cell(1:5);
    end
    methods
        function varargout = subsref(obj, s)
            disp(nargout)
            [varargout{1:nargout}] = obj.c{s(1).subs{:}};
        end
    end
end


... the following example produces different output on Octave vs. MATLAB.


x = nargout_in_subsref_bug();
x{1};
{x{1}};
x{[2 3]};
{x{[2 3]}};


Octave output:

0
1
0
1


MATLAB output:

     1

     1

     2

     2


In the examples I tried, nargout does seem to match for () and . indexing.

Ray Zimmerman <rdzman>

 

(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 mmuetzel (Updated the item)
  • -email is unavailable- added by tutissanalio (Posted a comment)
  • -email is unavailable- added by rdzman (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-23 mmuetzel CategoryInterpreter Classdef
    2021-06-04 rik5 Carbon-CopyRemoved 72865 -
    2021-06-04 rik5 StatusNone Confirmed
        Release6.2.0 dev

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code