bugGNU Octave - Bugs: bug #51534, Invoking parent class constructor...

 
 

bug #51534: Invoking parent class constructor in child constructor fails

Submitted by:  Piotr Held <jsoh425>
Submitted on:  Sat 22 Jul 2017 12:05:52 AM UTC  
 
Category: InterpreterSeverity: 4 - Important
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Piotr HeldOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 09 Aug 2017 03:39:17 PM UTC, comment #7:

I made a small tweak to the test code to use double quotes rather than single quotes to conform to Octave coding recommendations (http://hg.savannah.gnu.org/hgweb/octave/rev/12203140139f).

The tests now pass for me so I'm going to mark this as fixed and close the report.

Rik <rik5>
Project Administrator
Tue 08 Aug 2017 11:10:48 PM UTC, comment #6:

With a few minor edits, I pushed your changeset here:

http://hg.savannah.gnu.org/hgweb/octave/rev/ff893e26aeeb

I'm not sure whether a check is needed.

Thanks also for adding tests.

John W. Eaton <jwe>
Project Administrator
Tue 08 Aug 2017 06:44:09 PM UTC, comment #5:

I created a patch, which doesn't have to be final. My main question is: should the new code (past the &quot;if else&quot;) statement actually include a check if the called function is a superclass constructor?

I kind of assume that through the great siv that is tree_evaluator::visit_index_expression everything else would have been dealt with. If you guys think that I should include a check for calling the superclass then I'll do that. If you think it should be called somewhere else, then I'm open to that as well. If yes, then my question is: where?

I also included tests for the problem.

(file #41455)

Piotr Held <jsoh425>
Mon 07 Aug 2017 09:37:43 PM UTC, comment #4:

Coming back late to this report, but I now understand what is supposed to happen and can confirm that Octave is in error.

Rik <rik5>
Project Administrator
Mon 24 Jul 2017 06:29:07 PM UTC, comment #3:

On rev 2641a0196176, this is still not working.

To be clear, with my modification, there is no error message, but the Parent_Class constructor is still not called. Using the following definitions:

the property val is undefined after constructing a Child_Class object.

Mike Miller <mtmiller>
Project Administrator
Mon 24 Jul 2017 01:09:47 AM UTC, comment #2:

Could you repeat the test with Mike's modification from comment #1 and a cset >= 23784:f864950f837c?

It works for me. There was a recent fix to calling static class methods which may have made this work again.

Rik <rik5>
Project Administrator
Sat 22 Jul 2017 12:20:17 AM UTC, comment #1:

Confirmed, although this syntax isn't strictly correct. You aren't supposed to overwrite the self object. The base class constructor is supposed to be called as

Regardless, it does look like the base class constructor is not being called correctly anymore, this is a regression from the stable branch.

Mike Miller <mtmiller>
Project Administrator
Sat 22 Jul 2017 12:05:52 AM UTC, original submission:

When invoking parent class constructor in child constructor the parent constructor is not properly called.

For Parent Class:

And Child Class:

When calling:

You get:

Am attaching the test for this problem.

Piotr Held <jsoh425>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #41455:  patch_bug51534_ver1.diff added by jsoh425 (5KiB - text/x-patch)
file #41286:  Invoke_Parent_Constr.tar.gz added by jsoh425 (305B - application/gzip - Tests for the original submission)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by jsoh425 (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 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 09 Aug 2017 03:39:17 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 08 Aug 2017 11:10:48 PM UTCjweStatusConfirmed=>Ready For Test
    Tue 08 Aug 2017 06:44:09 PM UTCjsoh425Attached File-=>Added patch_bug51534_ver1.diff, #41455
    Mon 24 Jul 2017 06:29:07 PM UTCmtmillerStatusWorks For Me=>Confirmed
    Mon 24 Jul 2017 01:09:47 AM UTCrik5StatusConfirmed=>Works For Me
    Sat 22 Jul 2017 05:35:34 PM UTCmtmillerCategoryNone=>Interpreter
    Sat 22 Jul 2017 12:20:17 AM UTCmtmillerSeverity3 - Normal=>4 - Important
      StatusNone=>Confirmed
    Sat 22 Jul 2017 12:06:22 AM UTCjsoh425Attached File-=>Added Invoke_Parent_Constr.tar.gz, #41286

    Back to the top


    Powered by Savane 3.1-cleanup1