function bug60237
  disp(antest0)
  disp(antest1)
  disp(antest2)
  disp(antest3)
  disp(antest4)
end

function out = antest0
  a = 2;
  b = 20;
  
  function out = nest1
    a = a + 1;
    out = b;
  end
  
  function out = nest2
    b = b + 1;
    out = a;
  end
  
  out = [nest1() nest2() nest1() nest2()];
end

function out = antest1
  a = 2;
  b = 20;
  
  function out = nest1
    a = a + 1;
    out = b;
  end
  
  function out = nest2
    b = b + 1;
    out = a;
  end
  
  h1 = @() nest1;
  h2 = @() nest2;
  
  out = [h1() h2() h1() h2()];
end

function out = antest2
  a = 2;
  b = 20;
  
  function out = nest1
    a = a + 1;
    out = b;
  end
  
  function out = nest2
    b = b + 1;
    out = a;
  end
  
  h1 = @nest1;
  h2 = @nest2;
  
  out = [h1() h2() h1() h2()];
end

function out = antest3
  [h1, h2] = ancall3 ();
  out = [h1() h2() h1() h2()];
end

function [h1, h2] = ancall3
  a = 2;
  b = 20;
  
  function out = nest1
    a = a + 1;
    out = b;
  end
  
  function out = nest2
    b = b + 1;
    out = a;
  end
  
  h1 = @nest1;
  h2 = @nest2;
end

function out = antest4
  [h1, h2] = ancall4 ();
  out = [h1() h2() h1() h2()];
end

function [h1, h2] = ancall4
  a = 2;
  b = 20;
  
  function out = nest1
    a = a + 1;
    out = b;
  end
  
  function out = nest2
    b = b + 1;
    out = a;
  end
  
  h1 = @()nest1;
  h2 = @()nest2;
end