bugGNU Octave - Bugs: bug #63186, function handle in constructor of...

 
 

bug #63186: function handle in constructor of a class

Submitter:  Guillaume <gyom>
Submitted:  Sat 08 Oct 2022 08:29:28 PM UTC
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Sat 08 Oct 2022 08:29:28 PM UTC, original submission:  

If a function handle of a class is used in its constructor, the class seems to be broken afterwards. I attach a slightly contrived example that reproduces the issue:

>> s = classbug ("gnu octave");
>> s = classbug ({"gnu octave"});
>> s = classbug ("gnu octave");
error: no indexing!
error: called from
    subsref at line 17 column 7
    classbug at line 10 column 18

As you can see, after executing the second statement (that makes use of a function handle to the class), the first statement doesn't execute properly any more, with subsref() being called inappropriately. It works if "cellfun ('classbug',...)" is used instead of "cellfun (@classbug,...)".

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #53817:  classbug.m added by gyom (486B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    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.

     

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-10-08 gyom Attached File- Added classbug.m, #53817

    Back to the top


    Powered by Savane 3.9