bugGNU Octave - Bugs: bug #52614, setting properties of classdef...


bug #52614: setting properties of classdef object during construction with inheritance

Submitted by:  Amro <amro_octave>
Submitted on:  Thu 07 Dec 2017 03:56:19 PM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  4 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.


Fri 02 Feb 2018 09:16:49 AM UTC, comment #4:

@Nirabhra Tapaswi


Amro <amro_octave>
Fri 02 Feb 2018 04:55:42 AM UTC, comment #3:

@Nirabhra Tapaswi
not to discourage you, but I don't think this an easy bug for a new contributor...

I imagine you'd have to be pretty familiar with the C++ implementation of "classdef" functionality in Octave. This bug has to do with inheritance, method overriding, and object state during construction.

Then again I could be wrong :)

Amro <amro_octave>
Fri 26 Jan 2018 09:41:15 AM UTC, comment #2:

I am new to contributing to Octave and was searching for easy bugs, can you tell me which file this bug is in?

Nirabhra Tapaswi <barin97>
Wed 27 Dec 2017 08:36:23 PM UTC, comment #1:

Confirmed. This issue is still present on the development branch. I have changed the category to Matlab Compatibility.

I lowered the priority by 1 since there is a workaround.

Rik <rik5>
Project Administrator
Thu 07 Dec 2017 03:56:19 PM UTC, original submission:

I have a simple class hierarchy with two classes:

  • In the base class, the constructor calls a method which initializes some properties.
  • In the derived class, I override said method (while still calling the parent method). The constructor also invokes the parent constructor.

Here is a minimal example:

$ cat ClassA.m

$ cat ClassB.m

This works fine in MATLAB (I'm using R2017a):

But it fails in Octave 4.2.1:

I did try to incorporate the functionality of the foo method into the constructor (i.e directly set the properties a and b from the respective constructors), and the code does work then (both MATLAB and Octave):

$ cat ClassAA.m ClassBB.m

Still, I wanted to report this case... Thanks.

Amro <amro_octave>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

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 barin97 (Posted a comment)
  • -email is unavailable- added by amro_octave (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-27 rik5 Carbon-CopyRemoved 72865 => -
    2017-12-27 rik5 Priority5 - Normal => 4
        Item GroupUnexpected Error => Matlab Compatibility
        StatusNone => Confirmed
        Release4.2.1 => dev

    Back to the top

    Powered by Savane 3.3