Add a New Comment (Rich Markup)
Comment Type & Canned Response: None None > Multiple Canned Responses Fixed in development Crash with no stack trace Already fixed in newer version Fixed in stable Bad description Bad description and crash Bad stack trace Obsolete version Duplicate and not fixed Duplicate and needs more info Duplicate and fixed Need info and old
This had already regressed in Octave 6.4. (I haven't tested in which version exactly.) Imho, we shouldn't block Octave 7.3 on this.
Changing release to "dev".
Changing the release target to 7.1.0 because this is a regression iiuc.
just playing with structs and not classes, the following works in both matlab and octave, so it seems to be class specific?
>> a = struct('b',1) a = scalar structure containing the fields: b = 1 >> c = struct('d',a) c = scalar structure containing the fields: d = scalar structure containing the fields: b = 1 >> c.d ans = scalar structure containing the fields: b = 1 >> c.d.b ans = 1 >> c.d.b = 3 c = scalar structure containing the fields: d = scalar structure containing the fields: b = 3 >> clear c >> c(1) = struct('d',a) c = scalar structure containing the fields: d = scalar structure containing the fields: b = 1 >> c(2) = struct('d',a) c = 1x2 struct array containing the fields: d >> c.d ans = scalar structure containing the fields: b = 1 ans = scalar structure containing the fields: b = 1 >> c.d.b error: a cs-list cannot be further indexed >> c(1).d.b ans = 1 >> c(2).d.b ans = 1 >> c(2).d.b = 3 c = 1x2 struct array containing the fields: d >> c(2).d.b ans = 3
this does seem to be a compatability concern:
matlab 2021b:
>> obj(1) = foo; obj(2) = foo; obj(1).a.b ans = 1 >> obj(1).a.b = 2 obj = 1×2 foo array with properties: a >> obj(1).a.b ans = 2
Fails for me also with Octave 6.4.0. So, it doesn't look like a very recent regression.
There seems to be a regression with subsasgn in the context of array of objects and chained assignments. The following code works in 5.2 but returns the error below with dev:
classdef foo properties a; endproperties methods function obj = foo obj.a = struct ("b", 1); endfunction endmethods endclassdef
obj(1) = foo; obj(2) = foo; obj(1).a.b ans = 1 obj(1).a.b = 2 error: invalid dot name structure assignment because the structure array is empty. Specify a subscript on the structure array to resolve.
(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
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 project members can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 3 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.10