diff --git a/TestSuite/lambda_capture_local_vs_field.pas b/TestSuite/lambda_capture_local_vs_field.pas new file mode 100644 index 000000000..bcbafa6f9 --- /dev/null +++ b/TestSuite/lambda_capture_local_vs_field.pas @@ -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. \ No newline at end of file diff --git a/TestSuite/lambda_nonstatic_from_static.pas.pas b/TestSuite/lambda_nonstatic_from_static.pas.pas new file mode 100644 index 000000000..7da5d9cda --- /dev/null +++ b/TestSuite/lambda_nonstatic_from_static.pas.pas @@ -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. \ No newline at end of file