This commit is contained in:
parent
1680232dcb
commit
539a689732
17
TestSuite/delegates19.pas
Normal file
17
TestSuite/delegates19.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
var i: integer;
|
||||
procedure p1;
|
||||
begin
|
||||
|
||||
end;
|
||||
procedure p2;
|
||||
begin
|
||||
|
||||
end;
|
||||
procedure p3(p: procedure);
|
||||
begin
|
||||
i := 1;
|
||||
end;
|
||||
begin
|
||||
p3(true?p1:p2);
|
||||
assert(i = 1);
|
||||
end.
|
||||
|
|
@ -668,7 +668,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
|
||||
if (pct.first==null)
|
||||
{
|
||||
if (to is delegated_methods && (to as delegated_methods).empty_param_method != null)
|
||||
if (to is delegated_methods && (to as delegated_methods).empty_param_method != null && (to as delegated_methods).empty_param_method.ret_type != null)
|
||||
{
|
||||
return convert_type(en, (to as delegated_methods).empty_param_method.ret_type, loc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18618,7 +18618,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
{
|
||||
delegated_methods del_left = left.type as delegated_methods;
|
||||
delegated_methods del_right = right.type as delegated_methods;
|
||||
if (del_left != null && del_right != null && del_left.empty_param_method == null && del_right.empty_param_method == null)
|
||||
if (del_left != null && del_right != null && (del_left.empty_param_method == null && del_right.empty_param_method == null || del_left.empty_param_method.ret_type == null && del_right.empty_param_method.ret_type == null))
|
||||
{
|
||||
base_function_call bfc = del_left.proper_methods[0];
|
||||
common_type_node del =
|
||||
|
|
|
|||
Loading…
Reference in a new issue