bugGNU Octave - Bugs: bug #48802, function overload resolution on...


bug #48802: function overload resolution on function handles fails on classdef methods defined in class body

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Tue 16 Aug 2016 07:49:35 PM UTC  
Category: InterpreterSeverity: 1 - Wish
Priority: 5 - NormalItem 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.


Sat 20 Aug 2016 08:42:46 PM UTC, comment #1:

This bug only applies to classdef function overloads that are defined in the "methods" block of a class definition.

For old-style classes, all methods are defined in separate .m function files. If this is also done for a classdef class, then this bug does not apply.

Mike Miller <mtmiller>
Project Administrator
Tue 16 Aug 2016 07:49:35 PM UTC, original submission:

According to the Matlab documentation, a function handle should behave with respect to overloading the same way as any other function call would.

> Overloading — If the function you specify overloads a function in a class that is not a fundamental MATLAB class, the function is not associated with the function handle at the time it is constructed. Instead, MATLAB considers the input arguments and determines which implementation to call at the time of evaluation.

(From https://www.mathworks.com/help/matlab/matlab_prog/creating-a-function-handle.html.)

In other words, if I have a user-defined class that implements a double() conversion method,

this snippet should work correctly. Currently, Octave throws a "invalid conversion from object to double" error.

Mike Miller <mtmiller>
Project Administrator


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

Attach File(s):

No files currently attached


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -unavailable- added by mtmiller (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 20 Aug 2016 08:42:46 PM UTCmtmillerStatusNone=>Confirmed
      Summaryfunction overload resolution should be performed on function handles=>function overload resolution on function handles fails on classdef methods defined in class body
    Sat 20 Aug 2016 08:40:56 PM UTCmtmillerDependencies-=>bugs #48837 is dependent

    Back to the top

    Powered by Savane 3.1-cleanup1