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

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

[Octave-bug-tracker] [bug #53844] handle class: delete destructor method


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #53844] handle class: delete destructor method cannot access class properties
Date: Fri, 11 May 2018 18:54:38 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #5, bug #53844 (project octave):

Ok, here is the strange case that I am now running into. Consider the
following toy class


classdef dummy < handle

  properties
    id
  endproperties

  methods

    function self = dummy (id)
      if (nargin < 1)
        id = 'dummy';
      endif
      self.id = id;
    endfunction

    function delete (self)
      fprintf (stderr, '');
    endfunction

    function r = isa (self, klass)
      r = isequal (self.id, klass);
    endfunction

  endmethods

endclassdef


Now the following code at the interpreter prompt shows the problem


>> x = dummy;
>> isa (x, 'dummy')
ans = 1
>> isa (dummy, 'dummy')
>> 


Notice how the second call to 'isa' returns nothing at all.

If the delete method is removed, or if the method stays but the entire
function body is deleted or commented out, then this behaves as it should. But
if the destructor does *something*, then the method on the transient value
returns nothing.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53844>

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




reply via email to

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