Добавил тесты

This commit is contained in:
SunSerega 2019-06-11 16:43:27 +03:00
parent 180f1e55e6
commit dbc665a85b
2 changed files with 46 additions and 0 deletions

28
TestSuite/where8.pas Normal file
View file

@ -0,0 +1,28 @@
type
t0 = abstract class
function f0: integer; abstract;
end;
t1 = class(t0)
i: integer;
function f0: integer; override := i;
constructor(i: integer) := self.i := i;
end;
function f1<T>: T;
where T: t0;
begin
Result := T(t0(
new t1(10)
));
Result.f0.Println; // до #1986 было AccessViolationException
end;
begin
f1&<t1>;
// readln;
end.

18
TestSuite/where9.pas Normal file
View file

@ -0,0 +1,18 @@
function f1<TArray>: TArray;
where TArray: System.Array;
begin
Result := TArray(System.Array(
new integer[10]
));
Result.Length.Println; // до #1986 выводило 107, не зависимо от массива выше
end;
begin
f1&<array of integer>;
// readln;
end.