bugGNU Octave - Bugs: bug #44844, indexed field assignment in...

 
 

bug #44844: indexed field assignment in constructor converts legacy nested class object to struct

Submitter:  Carlo de Falco <cdf>
Submitted:  Wed 15 Apr 2015 09:49:01 AM UTC
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Rafael Vazquez Open/Closed:  * Open
Release:  * dev Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Tue 22 Aug 2017 07:33:58 PM UTC, comment #3: 

This has something to do specifically with either the nested definition of one object inside another, or with the indexing operation that is done inside the constructor, or the combination of both.

If I trivially rewrite the constructor to avoid nested indexing and assignments together like this:

tmp = prova (sp.knots(ind));
tmp.dofs = ind;
tmp.spline_space.dofs = tmp.dofs;
sp.boundary(iside) = tmp;

then it works correctly as in Matlab.

The error only happens because of the assignment

sp.boundary(iside).spline_space.dofs = sp.boundary(iside).dofs;

I'm unable to convert this class example to classdef, so I have to assume this affects legacy classes for now, until someone can show an example that also affects classdef.

Mike Miller <mtmiller>
Project Administrator
Tue 29 Nov 2016 02:43:46 PM UTC, comment #2: 

The issue still appears in 4.3.0+

Carlo de Falco <cdf>
Project Member
Tue 28 Jun 2016 09:33:06 AM UTC, comment #1: 

Same issue still appears in Octave 4.1+

Carlo de Falco <cdf>
Project Member
Wed 15 Apr 2015 09:49:01 AM UTC, original submission:  

Using the definitions of classes prova and prova2 in the aasignment

In Octave 3.8.2:

>> p = prova ([0 0 1 1])
p = <class prova>
>> p.boundary.spline_space
ans =

  scalar structure containing the fields:

    dofs =

       2   3   4


>>

in Matlab R2007b

>> p = prova ([0 0 1 1])

p =

        prova object: 1-by-1

>> p.boundary.spline_space

ans =

        prova2 object: 1-by-1

>>

Carlo de Falco <cdf>
Project Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #33680:  class-files.tar.gz added by cdf (711B - application/x-gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by cdf (Submitted the item)
  • -email is unavailable- added by cdf
  •  

    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.

     

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-22 mtmiller Item GroupIncorrect Result Matlab Compatibility
        StatusNone Confirmed
        Summaryfield assignment converts class object to struct indexed field assignment in constructor converts legacy nested class object to struct
    2016-06-28 cdf Release3.8.2 dev
    2015-04-15 cdf Attached File- Added class-files.tar.gz, #33680
        Carbon-Copy- Added -email is unavailable-

    Back to the top


    Powered by Savane 3.9