changeset 8162:293c4b5fe33d

symtab.cc (symbol_table::fcn_info::fcn_info_rep::load_class_method): Call load_class_constructor if name and dispatch_type are the same.
author John W. Eaton <jwe@octave.org>
date Mon, 29 Sep 2008 18:16:57 -0400
parents 64f1cd525656
children 7d6e659acc1a
files src/ChangeLog src/symtab.cc
diffstat 2 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Sep 29 18:08:53 2008 -0400
+++ b/src/ChangeLog	Mon Sep 29 18:16:57 2008 -0400
@@ -1,3 +1,8 @@
+2008-09-29  John W. Eaton  <jwe@octave.org>
+
+	* symtab.cc (symbol_table::fcn_info::fcn_info_rep::load_class_method):
+	Call load_class_constructor if name and dispatch_type are the same.
+
 2008-09-29  David Bateman  <dbateman@free.fr>
 
 	* symtab.cc (octave_value symbol_table::find_function 
--- a/src/symtab.cc	Mon Sep 29 18:08:53 2008 -0400
+++ b/src/symtab.cc	Mon Sep 29 18:16:57 2008 -0400
@@ -339,20 +339,26 @@
 {
   octave_value retval;
 
-  std::string dir_name;
-
-  std::string file_name = load_path::find_method (dispatch_type, name, dir_name);
-
-  if (! file_name.empty ())
+  if (name == dispatch_type)
+    retval = load_class_constructor ();
+  else
     {
-      octave_function *fcn = load_fcn_from_file (file_name, dir_name,
-						 dispatch_type);
+      std::string dir_name;
+
+      std::string file_name = load_path::find_method (dispatch_type, name,
+						      dir_name);
 
-      if (fcn)
+      if (! file_name.empty ())
 	{
-	  retval = octave_value (fcn);
+	  octave_function *fcn = load_fcn_from_file (file_name, dir_name,
+						     dispatch_type);
 
-	  class_methods[dispatch_type] = retval;
+	  if (fcn)
+	    {
+	      retval = octave_value (fcn);
+
+	      class_methods[dispatch_type] = retval;
+	    }
 	}
     }