[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65667] classdef calls overloaded function str
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct() |
Date: |
Sat, 4 May 2024 10:54:30 -0400 (EDT) |
Update of bug #65667 (group octave):
Status: None => Confirmed
Summary: inputParser does not accept object with struct
method as default value => classdef calls overloaded function struct() rather
than builtin struct()
_______________________________________________________
Follow-up Comment #1:
It helps to surround code examples in a bug report with the verbatim tag so
they are rendered in a fixed-width font.
The issue seems to be that testClass overloads the "struct" function with its
own definition and when
struct ("p", c)
is called it is the overloaded version of the function from testClass which
expects only one input which is called.
That is probably a bug, but it would be useful if someone could test this
under Matlab. I've re-titled the bug report and marked it as Confirmed.
For the time being, there are lots of workarounds and you should use one of
those.
Workaround #1: dot notation
s.p = c;
Workaround #2: use builtin() to call base function rather than overload
s = builtin ('struct', 'p', c);
Workaround #3: use a function which isn't overloaded.
s = struct ();
s = setfield ('p', c);
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65667>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #65667] inputParser does not accept object with struct method as default value, Tibor Auer, 2024/05/01
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(),
Rik <=
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Tibor Auer, 2024/05/04
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Philip Nienhuis, 2024/05/15
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Tibor Auer, 2024/05/15
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Tibor Auer, 2024/05/15
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Philip Nienhuis, 2024/05/15
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Rik, 2024/05/15
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Tibor Auer, 2024/05/16
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Nicholas Jankowski, 2024/05/16
- [Octave-bug-tracker] [bug #65667] classdef calls overloaded function struct() rather than builtin struct(), Tibor Auer, 2024/05/16