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:  Interpreter Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating 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 Files:

No files currently attached


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Submitted the item)

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

    Only project members can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-20 mtmiller StatusNone => Confirmed
        Summaryfunction overload resolution should be performed on function handles => function overload resolution on function handles fails on classdef methods defined in class body
    2016-08-20 mtmiller Dependencies- => bugs #48837 is dependent

    Back to the top

    Powered by Savane 3.3