fpc/tests/test/timpfuncspez1.pp
Sven/Sarah Barth 90844c2027 * fix #35261: apply slightly adjusted changes by Ryan Joseph to implement support for implicit generic function specializations
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
2022-04-20 18:59:31 +02:00

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.