I have the following methods.

I was expecting that Result := Save; would call Save method but in fact
Save refers to the function result variable.

Is it by design?

function TSqlite3JSONObjectResource.Save(IdValue: Variant): Boolean;
begin
  if not VarIsEmpty(IdValue) then
  begin
    [..]
  end
  else
  begin
    Result := Save; <- this does not call the overloaded method
    Result := Save(); <- this calls the overloaded method
  end;
end;

function TSqlite3JSONObjectResource.Save: Boolean;
begin
[..]
end;
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to