Добавил тесты
This commit is contained in:
parent
180f1e55e6
commit
dbc665a85b
28
TestSuite/where8.pas
Normal file
28
TestSuite/where8.pas
Normal 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
18
TestSuite/where9.pas
Normal 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.
|
||||||
Loading…
Reference in a new issue