I have an unexpected W1035 on compiling:
[dcc32 Warning] Unit1.pas(40): W1035 Return value of function 'Test' might be undefined
function CheckFn() : Boolean;
begin
Result := True;
end;
function Test() : Boolean;
begin
try
if(not CheckFn()) then
raise Exception.Create('Error Message');
Result := True;
finally
end;
end;
If I remove the try-finally
block, then the warning disappears.
function Test() : Boolean;
begin
if(not CheckFn()) then
raise Exception.Create('Error Message');
Result := True;
end;
Why is this happening? (Bug?)