octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48802] function overload resolution on functi


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #48802] function overload resolution on function handles fails on classdef methods defined in class body
Date: Fri, 4 Jan 2019 15:11:05 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #2, bug #48802 (project octave):

The problem seems to be that the function make_fcn_handle in ov-fcn-handle.cc
does the wrong thing.  It is called when evaluating the "@double" expression
in an attempt to bind the function handle early.  It works for overloaded
methods if they are defined in a separate file because it does search the
loadpath for overloaded function names.  But to do that for methods in
classdef classes would require parsing all possible classdef files just to
find out whether there are some overloads.  So the right thing seems to be to
avoid binding function handles until they are called since there is no
reasonable way to determine what function to call until a call is actually
attempted with arguments.  But the fix is not as simple as just having a
function handle store the name of the function.  It needs more context than
that to properly resolve subfunctions, nested functions, local functions, etc.
 So I see no simple fix.  This bug should probably also reference the one
about handles to nested functions, bug #39257.  These issues are related and I
think fixing them properly will require a bit of work.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?48802>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]