function bug55523
	%Good
	f1
	f3
	f9

	% error: 'a' undefined
	f2
	f10

	%Segmentation fault
	f4
	f5
	f6
	f7
	f8

end

function f1
	a = 1;
	b = 2;
	%Good
	fb = @(a = b) a;
	printf("testcase fb : %d\n",fb());
endfunction

function f2
	a = 1;
	b = 2;
	% error: 'a' undefined
	fa = @(a = a) a;
	printf("testcase fa : %d\n",fa());
endfunction

function f3
	a = 1;
	b = 2;
    %Good ,not using default argument
    print_in_handle = @(a = b) printf("testcase print_in_handle : %d\n",a);
    print_in_handle(7);
endfunction

function f4
	a = 1;
	b = 2;
    %Segmentation fault
	fb_pr = @(a = b) printf("testcase fb_pr : %d\n",a);
	fb_pr();
endfunction

function f5
	a = 1;
	b = 2;
    %Segmentation fault
	fa_pr = @(a = a) printf("testcase fa_pr : %d\n",a);
	fa_pr();
endfunction

function f6
	a = 1;
	b = 2;
    %Segmentation fault
	fb_disp = @(a = b) disp(a);
	fb_disp();
endfunction

function f7
	a = 1;
	b = 2;
    %Segmentation fault
	fa_disp = @(a = a) disp(a);
	fa_disp();
endfunction

function f8
	a = 1;
	b = 2;
    %Segmentation fault
	fa_disp = @(a = 3) disp(a);
	fa_disp();
endfunction

function f9
		a = 1;
		b = 2;
		%Good
		function ret = fb(a = b)
			ret = a;
		end
		disp(fb());
endfunction

function f10
		a = 1;
		b = 2;
		% error: 'a' undefined
		function ret = fa(a = a)
			ret = a;
		end
		disp(fa());
endfunction
