octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63841] nargout is always 1 for classdef metho


From: Rik
Subject: [Octave-bug-tracker] [bug #63841] nargout is always 1 for classdef methods
Date: Sun, 26 Feb 2023 20:48:22 -0500 (EST)

Update of bug #63841 (project octave):

                Severity:              3 - Normal => 5 - Blocker            
                Priority:              5 - Normal => 7 - High               
                  Status:                    None => Confirmed              
                 Summary: subsref gets wrong number of varargout elements =>
nargout is always 1 for classdef methods

    _______________________________________________________

Follow-up Comment #1:

Confirmed.  And the problem seems to be general to any method of a classdef
object.  I used the following code:


classdef tst_nargout
  methods
    function varargout = subsref (obj, s)
      nout = nargout
    end

    function varargout = myfunc (obj, s)
      nout = nargout
    end

  end
end


Using nargout in an ordinary method then produces the wrong answer.


o = tst_nargout
o =

  tst_nargout object with properties:


octave:2> [a,b,c] = o.myfunc ()
error: element number 1 undefined in return list
nout = 1




(file #54398)

    _______________________________________________________

Additional Item Attachment:

File name: tst_nargout.m                  Size:0 KB
    <https://file.savannah.gnu.org/file/tst_nargout.m?file_id=54398>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63841>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]