This commit is contained in:
parent
bf7972e7e7
commit
debd0ddee6
13
TestSuite/lambdas10.pas
Normal file
13
TestSuite/lambdas10.pas
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
procedure p0<T>(o: T; p: byte->()) := p(2);
|
||||
|
||||
procedure p1() := exit;
|
||||
|
||||
var i: integer;
|
||||
begin
|
||||
var p2: ()->() := ()->Inc(i);
|
||||
|
||||
p0(0, b-> p1() );
|
||||
p0(0, b-> p2.Invoke() );
|
||||
p0(0, b-> p2() );
|
||||
assert(i = 2);
|
||||
end.
|
||||
|
|
@ -19980,7 +19980,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
try
|
||||
{
|
||||
qq = convert_strong(ff.dereferencing_value);
|
||||
if (qq is exit_procedure && stl.list.Count == 1)
|
||||
if (qq is exit_procedure && stl.list.Count == 1 || qq is local_block_variable_reference && qq.type is compiled_type_node && (qq.type as compiled_type_node).compiled_type == typeof(Action))
|
||||
{
|
||||
// SSM #2172 27/06/20 - тело - это вызов exit
|
||||
stl.list[0] = new procedure_call(ff, ff.source_context);
|
||||
|
|
|
|||
Loading…
Reference in a new issue