|
From: | Markus Mützel |
Subject: | [Octave-bug-tracker] [bug #60143] Error "function called with too many outputs" when assigning to a property with set method |
Date: | Tue, 2 Mar 2021 03:12:12 -0500 (EST) |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.81 |
Follow-up Comment #16, bug #60143 (project octave): Re comment #11: I tried with the attached classes in Matlab R2020b: >> a = bug60143_value; >> a.t = 4 The set function for property 't' must return an instance of class 'bug60143_value'. >> a.u = 3 method set.u a = bug60143_value with properties: t: [] u: 3 >> b = bug60143_handle; >> b.t=2 method set.t In set function for property 't', the class of the output object is 'double'; the class of the input object is 'bug60143_handle'. They should be the same. >> b.u = 4 method set.u b = bug60143_handle with properties: t: [] u: 4 The syntax highlighter in its editor marks the set function for u in class `bug60143_value` with an error highlight "Set Methods must have at most one output.". But -- surprisingly -- it still seems to work (ignoring the extra output). It looks like it is possible that a set function of a handle class returns a different instance of the same class. That's interesting. I didn't know this was possible. I didn't check yet how Octave would behave in these cases. (file #50965, file #50966) _______________________________________________________ Additional Item Attachment: File name: bug60143_value.m Size:0 KB <https://file.savannah.gnu.org/file/bug60143_value.m?file_id=50965> File name: bug60143_handle.m Size:0 KB <https://file.savannah.gnu.org/file/bug60143_handle.m?file_id=50966> _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?60143> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |