[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #47241] Assigning property of handle object in
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #47241] Assigning property of handle object in object array constructs new object |
Date: |
Tue, 23 Feb 2016 23:40:11 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4 |
URL:
<http://savannah.gnu.org/bugs/?47241>
Summary: Assigning property of handle object in object array
constructs new object
Project: GNU Octave
Submitted by: None
Submitted on: Tue 23 Feb 2016 11:40:10 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Philip Roth
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 4.0.0
Operating System: Mac OS
_______________________________________________________
Details:
With a simple handle object:
classdef bogus < handle
properties
x
y
end
methods
function obj = bogus(x, y)
if nargin > 0
obj.x = x
obj.y = y
end
end
end
end
Then create an array of objects, assign a value to one property, then the
other, and the value assigned to the first property is reset (apparently
because a new object was constructed and copied into that array element).
>> n = int32(4)
n = 4
>> b(n) = bogus
constructing a bogus
constructing a bogus
b =
<object array bogus>
>> b(1).x = 1
constructing a bogus
b =
<object array bogus>
>> b(1).y = 2
constructing a bogus
b =
<object array bogus>
>> b(1).x
ans = [](0x0)
Expected behavior is that b(1).x is 1, and b(1).y is 2 after the operations
complete. Same behavior observed with both Octave 4.0 and Octave 4.1
installed via MacPorts.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47241>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #47241] Assigning property of handle object in object array constructs new object,
anonymous <=