tests added
This commit is contained in:
parent
69826046b1
commit
dac1bbe3b9
24
TestSuite/lambda_capture_local_vs_field.pas
Normal file
24
TestSuite/lambda_capture_local_vs_field.pas
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
type
|
||||||
|
t1 = class
|
||||||
|
|
||||||
|
static a: integer := 1;//не обязательно статичное поле
|
||||||
|
|
||||||
|
procedure p1;
|
||||||
|
begin
|
||||||
|
var a := 2;
|
||||||
|
var p: procedure := ()->begin
|
||||||
|
|
||||||
|
Assert(a=2);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
p;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
(new t1).p1;
|
||||||
|
|
||||||
|
end.
|
||||||
24
TestSuite/lambda_nonstatic_from_static.pas.pas
Normal file
24
TestSuite/lambda_nonstatic_from_static.pas.pas
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
type
|
||||||
|
t1 = class
|
||||||
|
|
||||||
|
b: byte;
|
||||||
|
|
||||||
|
static procedure p1(b: byte);
|
||||||
|
begin
|
||||||
|
|
||||||
|
var p: procedure;
|
||||||
|
p := ()->
|
||||||
|
begin
|
||||||
|
p := ()->
|
||||||
|
begin
|
||||||
|
b := b;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Assert(1=1);
|
||||||
|
end.
|
||||||
Loading…
Reference in a new issue