bugGNU Octave - Bugs: bug #42735, subclass inheritence: symbol ops...


bug #42735: subclass inheritence: symbol ops (e.g., plus, mtimes) do not respect superiorto

Submitted by:  Colin Macdonald <cbm>
Submitted on:  Fri 11 Jul 2014 11:08:52 PM UTC  
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Fri 11 Jul 2014 11:30:50 PM UTC, comment #2:

Unsurprisingly, "<double> + C" seems to work. Its just P + C that does the wrong thing.

Colin Macdonald <cbm>
Fri 11 Jul 2014 11:09:38 PM UTC, comment #1:

also present in 3.6.4.

Colin Macdonald <cbm>
Fri 11 Jul 2014 11:08:52 PM UTC, original submission:

I have a class called parent and a class called child.

Say P is instance of parent and C is instance of child.

parent and child have "myplus" and "plus" methods.

1) P+C and C+P call different plus methods, independent of whether superiotor('parent') is set. This behaviour DOES NOT match matlab.

2) plus(P,C) and plus(C,P) call the child plus method if superiorto is set, otherwise different methods. This behaviour matches matlab 2008a.

3) myplus(P,C) and myplus(C,P) call the child myplus method if superiorto is set, otherwise different methods. This behaviour matches matlab 2008a.

Tested with plus, minus, mtimes. Tested on 3.8.1 and "hg - 1 month".

(personally, I don't see why I'd ever want the behaviour w/o superiorto, but that is not the bug here)

I'll attach my minimal example: untar and run mytest.m

Colin Macdonald <cbm>


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

Attach File(s):

Attached Files
file #31704:  inheritance.tar added by cbm (20kB - application/x-tar)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by cbm (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):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 11 Jul 2014 11:08:52 PM UTCcbmAttached File-=>Added inheritance.tar, #31704

    Back to the top

    Powered by Savane 3.1-cleanup