--
-- This is a test of semantic checking for test12 - test17.
--
package test18 is body
    i : integer;
    procedure factorial() is
	j : integer;
	procedure j(); -- name conflict with variable 'j' in same scope
	procedure i(); -- this is okay though
	procedure times() is begin
	    i := i * j; -- declared as procedure, and referred to as a variable
	    if j <> i then j := j + 1; times(); end if;
	    fubar();  -- fubar is an undefined procedure
	end;
	procedure i(); -- this is an illegal redeclaration
    begin
	-- (warning) the body of 'i' was never given
	j := 1;
	times();
    end;
begin 
    i := 6;
    factorial();
    write("factorial of 6 = ", i, " (should be 720)");
end.
