This commit is contained in:
Бондарев Иван 2020-01-12 18:01:01 +01:00
parent dac1a87ff7
commit 9155cc7921
2 changed files with 16 additions and 1 deletions

View file

@ -6741,7 +6741,10 @@ namespace PascalABCCompiler.NETGenerator
else
{
TypeInfo ti = helper.GetTypeReference(value.return_value_type);
ret_type = ti.tp;
if (ti == null && value.return_value_type.name == null)//not used lambda, ignore
ret_type = TypeFactory.VoidType;
else
ret_type = ti.tp;
if (IsNeedCorrectGetType(cur_ti, ret_type))
{
ret_type = ret_type.MakePointerType();

View file

@ -0,0 +1,12 @@
procedure p0(l: System.Delegate) := l.DynamicInvoke();
begin
var i := 0;
p0(()->
begin
i := 2;
Result := true;
end);
assert(i = 2);
end.