bugGNU Octave - Bugs: bug #54783, subsasgn call when the subscripted...

 
 

bug #54783: subsasgn call when the subscripted expression contains the end keyword

Submitted by:  Guillaume <gyom>
Submitted on:  Thu 04 Oct 2018 03:56:22 PM UTC  
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  Closed
Release:  5.0.91 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 22 Feb 2019 10:22:11 AM UTC, comment #5: 

Thanks John and Kai, it works for me. This report can be closed as fixed.

Guillaume <gyom>
Thu 21 Feb 2019 02:14:42 PM UTC, comment #4: 

I pushed an overhauled classdef test to stable:

https://hg.savannah.gnu.org/hgweb/octave/rev/ad71c8d87cff

Again, if there are strong objections about applying it just before the 5.1 release I could delay it, too.

The comment #0 is resolved for me.

Kai Torben Ohlhus <siko1056>
Project Member
Thu 21 Feb 2019 07:21:34 AM UTC, comment #3: 

I pushed this changeset to stable:

http://hg.savannah.gnu.org/hgweb/octave/rev/17d806c3f7cd

If there are strong objections about applying it just before the 5.1 release I could delay it.

Would someone like to create a proper test from the code in the original submission below that could be added to the test suite?

John W. Eaton <jwe>
Project Administrator
Fri 15 Feb 2019 12:50:31 PM UTC, comment #2: 

Thanks Kai, I hadn't made the link and can confirm that the patch in file #45680 fixes the issue reported here.

Guillaume <gyom>
Tue 12 Feb 2019 03:48:39 PM UTC, comment #1: 

This issue can be fixed by applying patch (file #45680) from bug #55223.

Kai Torben Ohlhus <siko1056>
Project Member
Thu 04 Oct 2018 03:56:22 PM UTC, original submission:  

If you define this class:

classdef testasgn

  properties
    x;
  end

  methods
    function v = subsref (this, s)
      fprintf ('subsref\n');
      for i = 1:numel (s)
        disp (s(i))
      end
      v = 1:5;
    end

    function this = subsasgn (this, s, v)
      fprintf ('subsasgn\n');
      for i = 1:numel (s)
        disp (s(i))
      end
    end
  end

end

You get the following in Matlab:

>> m = testasgn;
>> m.x(end) = 0;
subsref
    type: '.'
    subs: 'x'

subsasgn
    type: '.'
    subs: 'x'

    type: '()'
    subs: {[5]}

>> m.y(end) = 0;
subsref
    type: '.'
    subs: 'y'

subsasgn
    type: '.'
    subs: 'y'

    type: '()'
    subs: {[5]}

while Octave does:

>> m = testasgn;
>> m.x(end) = 0;
subsasgn
  scalar structure containing the fields:

    type = .
    subs = x
  scalar structure containing the fields:

    type = ()
    subs =
    {
      [1,1] = 0
    }

>> m.y(end) = 0;
error: subsref: unknown method or property: y

My understanding of it is that, when m.x is evaluated, the subsref function called is the one for the underlying structure and not the method of the class as it should be.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-22 siko1056 StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
        Releasedev => 5.0.91
    2019-02-21 jwe StatusConfirmed => Ready For Test
    2019-02-12 siko1056 Dependencies- => Depends on bugs #55223
    2019-02-12 siko1056 StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.5