bug fix #2115
This commit is contained in:
parent
cf69fdc20f
commit
1ddc76a614
17
TestSuite/delegates12.pas
Normal file
17
TestSuite/delegates12.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
procedure p := exit;
|
||||
|
||||
var i: integer;
|
||||
|
||||
procedure p1;
|
||||
begin
|
||||
if p = nil then
|
||||
i := 1
|
||||
else if nil = p then
|
||||
i := -1
|
||||
else
|
||||
i := 2;
|
||||
end;
|
||||
begin
|
||||
p1;
|
||||
assert(i = 2);
|
||||
end.
|
||||
|
|
@ -1246,7 +1246,10 @@ namespace PascalABCCompiler.TreeConverter
|
|||
base_function_call bfc = ((left as typed_expression).type as delegated_methods).proper_methods[0];
|
||||
left = convertion_data_and_alghoritms.explicit_convert_type(left, CreateDelegate(bfc.simple_function_node));
|
||||
sil = left.type.find_in_type(name);
|
||||
bfc = ((right as typed_expression).type as delegated_methods).proper_methods[0];
|
||||
if (!(right is typed_expression) && right.type is delegated_methods)
|
||||
bfc = (right.type as delegated_methods).proper_methods[0];
|
||||
else
|
||||
bfc = ((right as typed_expression).type as delegated_methods).proper_methods[0];
|
||||
right = convertion_data_and_alghoritms.explicit_convert_type(right, CreateDelegate(bfc.simple_function_node));
|
||||
sil2 = right.type.find_in_type(name);
|
||||
if (saved_sil != null && sil != null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue