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
24 lines
456 B
ObjectPascal
24 lines
456 B
ObjectPascal
{$mode objfpc}
|
|
{$modeswitch implicitfunctionspecialization}
|
|
{
|
|
Test open arrays and array constructors
|
|
}
|
|
|
|
program timpfuncspez2;
|
|
uses
|
|
typinfo;
|
|
|
|
generic function DoThis<T>(a: array of T): TTypeKind;
|
|
begin
|
|
writeln(GetTypeKind(T), ': ', Length(a));
|
|
result := GetTypeKind(T);
|
|
end;
|
|
|
|
begin
|
|
if DoThis(['a','b','c']) <> tkChar then
|
|
Halt(-1);
|
|
if DoThis(['aaa','bbb','ccc']) <> tkString then
|
|
Halt(-1);
|
|
if DoThis([1,2,3]) <> tkInteger then
|
|
Halt(-1);
|
|
end. |