bugGNU Octave - Bugs: bug #58523, nested functions called through...

 
 

bug #58523: nested functions called through anonymous functions forget variables in parent function

Submitter:  Daniel Molina García <dmolina>
Submitted:  Sun 07 Jun 2020 01:35:33 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 09 Jun 2020 06:52:38 PM UTC, comment #2: 

Thanks. Closing report as a duplicate of bug #48086

Pantxo Diribarne <pantxo>
Group Member
Sun 07 Jun 2020 01:40:24 PM UTC, comment #1: 

Sorry, I found that it was reported before in #48086 and later.

Daniel Molina García <dmolina>
Sun 07 Jun 2020 01:35:33 PM UTC, original submission:  

Example to reproduce it:

Consider the following function file:


function out = f ()
  v = 3;
  function out2 = fnested()
    out2 = v;
  endfunction
  h = @() fnested();
  h();
endfunction


and call it from octave


octave:1> f()
error: 'v' undefined near line 4, column 4
error: called from
    f>fnested at line 4 column 10
    f>@<anonymous> at line 6 column 12
    f at line 7 column 3


It was working in 5.2.0.

Daniel Molina García <dmolina>

 

(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 pantxo (Posted a comment)
  • -email is unavailable- added by dmolina (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 group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-09 pantxo StatusNone Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #48086

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code