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

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

[Octave-bug-tracker] [bug #50671] Writing of property values in object a


From: Stephan Jaeckel
Subject: [Octave-bug-tracker] [bug #50671] Writing of property values in object arrays delets all other property values
Date: Wed, 29 Mar 2017 10:05:24 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

URL:
  <http://savannah.gnu.org/bugs/?50671>

                 Summary: Writing of property values in object arrays delets
all other property values
                 Project: GNU Octave
            Submitted by: stephan8282
            Submitted on: Wed 29 Mar 2017 02:05:23 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: stephan8282
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:

When setting properties of an element in an object array, other properties of
the same object get retested to their default values. This only happens with
arrays of objects.

Minimal classdef:

classdef dummy < handle

    properties
        name = 'bla';
        value = 1;
    end
        
end


Example:

% Works
clear d
d = dummy
d.name = 'test';
d.value = 2;
d.name % Should be 'test' --> OK

% Doesnt work
clear d
d(1) = dummy
d(1).name = 'test';
d(1).value = 2;
d(1).name % Should be 'test', but is 'bla'

% Possible temporary workaround
clear d
d(1) = dummy

d_tmp = d(1);
d_tmp.name = 'test';
d_tmp.value = 2;

d(1) = d_tmp;
d(1).name % Correct
d(1).value % Correct






    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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