This commit is contained in:
Ivan Bondarev 2022-09-12 20:27:26 +02:00
parent 673e3882c9
commit aaa04cdb16
3 changed files with 11 additions and 2 deletions

View file

@ -10900,7 +10900,6 @@ namespace PascalABCCompiler.NETGenerator
il.Emit(OpCodes.Br, EndLabel);
il.MarkLabel(NullLabel);
value.ret_if_null.visit(this);
ti = helper.GetTypeReference(value.ret_if_null.type);
if (ti != null)
EmitBox(value.ret_if_null, ti.tp);
il.MarkLabel(EndLabel);

View file

@ -0,0 +1,11 @@
var i: integer;
procedure test(o: object);
begin
i := integer(o);
end;
begin
var x: Object := nil;
var y:= x ?? 10;
test(y);
assert(i = 10);
end.

View file

@ -18580,7 +18580,6 @@ namespace PascalABCCompiler.TreeConverter
{
right = convertion_data_and_alghoritms.convert_type(right, left.type);
}
}
}