mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 15:49:04 +02:00

The main adjustments were as follows: - fixing coding style and identation - fixing some typos - using a better name for the property in tcallcandidates which holds the symbols created for anonymous parameter values
31 lines
439 B
ObjectPascal
31 lines
439 B
ObjectPascal
{$mode objfpc}
|
|
{$modeswitch implicitfunctionspecialization}
|
|
{
|
|
Test precedence
|
|
}
|
|
|
|
program timpfuncspez1;
|
|
|
|
function Test(const aStr: String): LongInt;
|
|
begin
|
|
Result := 1;
|
|
end;
|
|
|
|
generic function Test<T>(aT: T): LongInt;
|
|
begin
|
|
Result := 2;
|
|
end;
|
|
|
|
operator := (aArg: LongInt): String;
|
|
begin
|
|
Result := '';
|
|
end;
|
|
|
|
begin
|
|
if Test('Hello World')<>1 then
|
|
Halt(-1);
|
|
if Test(42)<>2 then
|
|
Halt(-1);
|
|
if Test(String(42))<>1 then
|
|
Halt(-1);
|
|
end. |