diff -r 540db74cff86 libinterp/corefcn/symtab.cc --- a/libinterp/corefcn/symtab.cc Wed Dec 09 13:56:47 2015 +1100 +++ b/libinterp/corefcn/symtab.cc Wed Dec 09 19:45:52 2015 +1100 @@ -1322,6 +1322,43 @@ symbol_table::find_function (const std:: return retval; } +// look for @class/method>subfunction +octave_value +symbol_table::find_submethod (const std::string& name, + const std::string& dispatch_type) +{ + octave_value fcn; + std::string full_name = "@" + dispatch_type + file_ops::dir_sep_str () + name; + size_t pos = full_name.find_first_of (Vfilemarker); + + if (pos != std::string::npos) + { + std::string fcn_scope = full_name.substr (0, pos); + scope_id stored_scope = xcurrent_scope; + xcurrent_scope = xtop_scope; + octave_value parent = find_function (full_name.substr (0, pos), + octave_value_list (), false); + //octave_value parent = find_method (full_name.substr (0, pos), + // dispatch_type); + if (parent.is_defined ()) + { + octave_function *parent_fcn = parent.function_value (); + + if (parent_fcn) + { + xcurrent_scope = parent_fcn->scope (); + + if (xcurrent_scope > 1) + fcn = find_function (full_name.substr (pos + 1), + octave_value_list ()); + } + } + + xcurrent_scope = stored_scope; + } + return fcn; +} + void symbol_table::dump (std::ostream& os, scope_id scope) { diff -r 540db74cff86 libinterp/corefcn/symtab.h --- a/libinterp/corefcn/symtab.h Wed Dec 09 13:56:47 2015 +1100 +++ b/libinterp/corefcn/symtab.h Wed Dec 09 19:45:52 2015 +1100 @@ -1505,13 +1505,23 @@ public: fcn_table_const_iterator p = fcn_table.find (name); if (p != fcn_table.end ()) - return p->second.find_method (dispatch_type); + { + octave_value fcn = p->second.find_method (dispatch_type); + + if (!fcn.is_defined ()) + fcn = find_submethod (name, dispatch_type); + + return fcn; + } else { fcn_info finfo (name); octave_value fcn = finfo.find_method (dispatch_type); + if (!fcn.is_defined ()) + fcn = find_submethod (name, dispatch_type); + if (fcn.is_defined ()) fcn_table[name] = finfo; @@ -1520,6 +1530,9 @@ public: } static octave_value + find_submethod (const std::string& name, const std::string& dispatch_type); + + static octave_value find_built_in_function (const std::string& name) { fcn_table_const_iterator p = fcn_table.find (name);