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

 
 

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

Submitted by:  Ray Zimmerman <rdzman>
Submitted on:  Thu 03 Jun 2021 06:55:47 PM UTC  
 
Category:  Interpreter 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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 tutissanalio (Posted a comment)
  • -email is unavailable- added by rdzman (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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.7