# HG changeset patch # User Rik # Date 1523490353 25200 # Node ID 22ece7843499cc2380396ffcd5dd307198d28163 # Parent e98c6d393abb1798f7482646d32619c72b73b906 Allow a single metaclass for Access property of classdef objects (bug #53601) * ov-classdef.cc (check_access): Add an additional elseif to input parsing to look for an object (metaclass) as input. If found, verify that the metaclass is either the same as the current class or is a superclass of the object. diff -r e98c6d393abb -r 22ece7843499 libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Wed Apr 11 15:23:44 2018 -0400 +++ b/libinterp/octave-value/ov-classdef.cc Wed Apr 11 16:45:53 2018 -0700 @@ -364,6 +364,22 @@ panic_impossible (); } } + else if (acc.isobject ()) + { + cdef_class ctx = get_class_context (); + + // At this point, a class context is always required. + if (ctx.ok ()) + { + if (ctx == cls) + return true; + + cdef_class acc_cls (to_cdef (acc)); + + if (is_superclass (acc_cls, ctx)) + return true; + } + } else if (acc.iscell ()) { Cell acc_c = acc.cell_value ();