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

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

[Octave-bug-tracker] [bug #61898] subsref: Error when field syntax is us


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #61898] subsref: Error when field syntax is used on non-scalar @class object
Date: Fri, 4 Feb 2022 12:19:00 -0500 (EST)

Follow-up Comment #4, bug #61898 (project octave):

I think I found a smaller reproducer. See attachment. Please check if this is
actually reproducing this bug or it is something else.

In Octave 6.4.0:

>> a = bug61898_subsref([1 1]);

>> numel(a)

ans = 2
>> a.b

Hello
ans =

  <class bug61898_subsref>


In Octave 7.0.90:

>> a = bug61898_subsref([1 1]);

>> numel(a)

ans = 2
>> a.b

error: subsref: function called with too many outputs
error: called from
    subsref


In Matlab R2021a:

>> a = bug61898_subsref([1 1]);
>> numel(a)

ans =

     2

>> a.b
Error using bug61898_subsref/subsref
Too many output arguments.


So, while this is a change in behavior between Octave 6 and Octave 7, it seems
to be compatible with Matlab to emit that error in this case.

Not sure what is more important. Matlab-compatiblity or
backward-compatibility?

(file #52803)
    _______________________________________________________

Additional Item Attachment:

File name: @bug61898_subsref.zip          Size:1 KB
    <https://file.savannah.gnu.org/file/@bug61898_subsref.zip?file_id=52803>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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