bugGNU Octave - Bugs: bug #51820, OO: default values invoking...

 
 

bug #51820: OO: default values invoking constructor without arguments.

Submitted by:  Ernst Reissner <ernstreissner>
Submitted on:  Tue 22 Aug 2017 02:36:41 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: DuplicateAssigned to: None
Originator Name: Open/Closed: Closed
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.

 

Tue 22 Aug 2017 08:54:10 PM UTC, comment #2:

Dear Mike, there it was classified as a wish.
This is not true from what is mentioned here about matlab.
Please update the other bug: no wish, bug.

Thank you.

Ernst Reissner <ernstreissner>
Tue 22 Aug 2017 05:12:34 PM UTC, comment #1:

This was already reported, see bug #50367. In that bug report it was already confirmed that this is a lacking feature for legacy style classes, but does work correctly with classdef classes.

Mike Miller <mtmiller>
Project Administrator
Tue 22 Aug 2017 02:36:41 PM UTC, original submission:

I have written a (legacy) class implementing arithmetics in java, called pn
for polymorphic number.

have a look at
https://www.mathworks.com/help/matlab/matlab_oop/class-constructor-methods.html#btn2kiy,
to be more precise to the guidelines
talking about constructors without arguments.
This refers to

This is true even outside oo:
a(5)=1 on unkown a performs padding a(1)...a(4)
with default value 0.
Consequently,
a(5)=pn(1) performs padding a(1)...a(4)
with default value pn() which represents 0 also in my case.

Unlike prior releases, now pn() does not get invoked.
Instead some raw constructor seems to be invoked,
merely applying function class(...)
but not providing a sensible default value.

Ernst Reissner <ernstreissner>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

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

    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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 22 Aug 2017 05:12:34 PM UTCmtmillerStatusNone=>Duplicate
      Open/ClosedOpen=>Closed
      Dependencies-=>Depends on bugs #50367
    Tue 22 Aug 2017 02:36:41 PM UTCernstreissnerCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1