This commit is contained in:
Ivan Bondarev 2022-06-16 13:48:15 +02:00
parent 7f2776dbe3
commit c79e262327
2 changed files with 20 additions and 0 deletions

13
TestSuite/operators2.pas Normal file
View file

@ -0,0 +1,13 @@
type
t1 = class
static function operator=(a,b: t1) := true;
end;
t2 = class(t1) end;
begin
var a := new t2;
var b := new t2;
assert(a = b);
end.

View file

@ -2799,6 +2799,13 @@ namespace PascalABCCompiler.TreeConverter
return set_of_possible_functions[0];
}
}
if (set_of_possible_functions.Count == 2)
{
if (set_of_possible_functions[0].semantic_node_type == semantic_node_type.basic_function_node && set_of_possible_functions[1].semantic_node_type != semantic_node_type.basic_function_node)
return set_of_possible_functions[1];
else if (set_of_possible_functions[1].semantic_node_type == semantic_node_type.basic_function_node && set_of_possible_functions[0].semantic_node_type != semantic_node_type.basic_function_node)
return set_of_possible_functions[0];
}
return AddError<function_node>(new SeveralFunctionsCanBeCalled(loc, set_of_possible_functions));
}