bugGNU Octave - Bugs: bug #66229, class destructor delete cannot...

 
 

bug #66229: class destructor delete cannot access protected data

Submitter:  Reimund <rayman>
Submitted:  Tue 17 Sep 2024 05:49:23 PM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 9.2.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 17 Sep 2024 05:49:23 PM UTC, original submission:  

Hi, when using a destructor method in class, it throws a subsref warning:

warning: error caught while executing handle class delete method:
subsref: property 'test' has protected access and cannot be obtained in this context

Example class:

classdef Test < handle
  properties (Access = protected)
    test
  end

  methods
    function obj = Test()
      obj.test = true;
    end

    function delete(obj)
      if obj.test
        x = 1;
      end
    end
  end
end


I hope this can be fixed...
Kind regards, Reimund

Reimund <rayman>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rayman (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-5884.
    Corresponding source code