mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 17:19:33 +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
34 lines
604 B
ObjectPascal
34 lines
604 B
ObjectPascal
{$mode objfpc}
|
|
{$modeswitch implicitfunctionspecialization}
|
|
{
|
|
Test open arrays and array constructors
|
|
}
|
|
|
|
program timpfuncspez32;
|
|
uses
|
|
typinfo;
|
|
|
|
generic function DoThis<T>(a: array of T): TTypeKind;
|
|
begin
|
|
writeln(GetTypeKind(T), ': ', Length(a));
|
|
result := GetTypeKind(T);
|
|
end;
|
|
|
|
type
|
|
TIntArray = array of integer;
|
|
var
|
|
s1: array of integer;
|
|
s2: array[0..2] of integer;
|
|
begin
|
|
s1 := [1,2,3];
|
|
if DoThis(s1) <> tkInteger then
|
|
Halt(-1);
|
|
|
|
s2 := [1,2,3];
|
|
if DoThis(s2) <> tkInteger then
|
|
Halt(-1);
|
|
|
|
s1 := TIntArray.Create(1,2,3);
|
|
if DoThis(s1) <> tkInteger then
|
|
Halt(-1);
|
|
end. |