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: InterpreterSeverity: 3 - Normal
Priority: 4Item Group: Matlab Compatibility
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating 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

http://hg.savannah.gnu.org/hgweb/octave/file/tip/libinterp/octave-value/ov-classdef.cc

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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by barin97 (Posted a comment)
  • -unavailable- added by amro_octave (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 27 Dec 2017 08:36:39 PM UTCrik5Carbon-CopyRemoved 72865=>-
    Wed 27 Dec 2017 08:36:23 PM UTCrik5Priority5 - Normal=>4
      Item GroupUnexpected Error=>Matlab Compatibility
      StatusNone=>Confirmed
      Release4.2.1=>dev

    Back to the top


    Powered by Savane 3.1-cleanup1