changeset 24075:3645139bd28f

allow meta.class.fromName to work again (bug #51935) * pt-eval.cc (tree_evaluator::visit_index_expression): Also check whether the result of a partial evaluation is a classdef_meta and not a package. * classdef.tst: New test.
author Piotr Held <pjheld@gmail.com>
date Tue, 05 Sep 2017 17:38:51 -0700
parents ff973f3e17e3
children 1b7e49a72c62
files libinterp/parse-tree/pt-eval.cc test/classdef/classdef.tst
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-eval.cc	Wed Aug 30 10:47:15 2017 -0700
+++ b/libinterp/parse-tree/pt-eval.cc	Tue Sep 05 17:38:51 2017 -0700
@@ -1339,7 +1339,9 @@
                         idx.clear ();
 
                         if (partial_expr_val.isobject ()
-                            || partial_expr_val.isjava ())
+                            || partial_expr_val.isjava ()
+                            || (partial_expr_val.is_classdef_meta ()
+                                && ! partial_expr_val.is_package ()))
                           {
                             // Found an object, so now we'll build up
                             // complete index list for one big subsref
--- a/test/classdef/classdef.tst	Wed Aug 30 10:47:15 2017 -0700
+++ b/test/classdef/classdef.tst	Tue Sep 05 17:38:51 2017 -0700
@@ -76,6 +76,10 @@
 %!assert (class (plist_t2), "plist_t2")
 %!assert (class (plist_t3), "plist_t3")
 
+%% Test for meta.class.fromName
+%!test <*51935>
+%! meta.class.fromName ("inputParser");
+
 ## Do not change this to "containers.Map()".  This test is intended to
 ## ensure that calling a function in a +package directory will work
 ## properly.