Hi,
I saw an interesting bug on C++, and I was wondering how to solve this
type of bug in Pascal:

{$MODE OBJFPC}
program namespace_test;

function test : boolean;
begin
 result := true;
end;

type
 TTest = class
    function test : boolean;
 end;

function TTest.test : boolean;
begin
 result := test;
end;

var
 c_test : TTest;

begin
 c_test := TTest.create;
 try
   writeln (c_test.test);
 finally
   c_test.free;
 end;
end.

OK the question is, the TTest.test, what is the test function that it
will call, the one inside the class, or the one outside it (I belive
that it will call itself once), and how can i call the function
outside the class ?

Ido
--
http://ik.homelinux.org/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to