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

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

[Octave-bug-tracker] [bug #58565] isprop() doesn't work for classdef ins


From: Neil Konzen
Subject: [Octave-bug-tracker] [bug #58565] isprop() doesn't work for classdef instances
Date: Sun, 14 Jun 2020 07:36:08 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45

URL:
  <https://savannah.gnu.org/bugs/?58565>

                 Summary: isprop() doesn't work for classdef instances
                 Project: GNU Octave
            Submitted by: waterdog1
            Submitted on: Sun 14 Jun 2020 11:36:06 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: waterdog1
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

isprop() always fails for classdef instances.

With the following class in the current directory:


classdef value_class
properties
foo = 123.45;
end
end


The following code illustrates the problem:


obj=value_class();
assert(isprop(obj,'foo'));


An easy fix is to use .() inside a try/catch.  In isprop.m, replace the
innermost endif with:


elseif isobj(obj)
  try
    v = obj.(prop);
    res(i) = true;
  end_try_catch
endif





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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