This commit is contained in:
Ivan Bondarev 2024-12-08 18:08:00 +01:00
parent 494b47624d
commit 45fdde24b4
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,21 @@
var i: integer;
type
MyClass<T> = record
static function operator implicit(a: array of T): MyClass<T>;
begin
Inc(i);
end;
static function operator=(first, second: MyClass<T>) := True;
end;
ott = (one, two, three);
stype = MyClass<ott>;
begin
var g: array of ott := |one,three|;
var s: MyClass<ott> := new MyClass<ott>;
var b := (g = s);
assert(i = 1);
// ppp(g,s);
end.

View file

@ -2883,6 +2883,7 @@ namespace PascalABCCompiler.TreeConverter
{
var tlist = new List<function_node>();
tlist.Add(f2);
convert_function_call_expressions(tlist[0], parameters, tcll[0]);
return tlist;
}
}
@ -2960,6 +2961,7 @@ namespace PascalABCCompiler.TreeConverter
set_of_possible_functions.Remove(fn);
var tlist = new List<function_node>();
tlist.Add(set_of_possible_functions[0]);
convert_function_call_expressions(tlist[0], parameters, tcll[0]);
return tlist;
}
}
@ -2969,12 +2971,14 @@ namespace PascalABCCompiler.TreeConverter
{
var tlist = new List<function_node>();
tlist.Add(set_of_possible_functions[1]);
convert_function_call_expressions(tlist[0], parameters, tcll[0]);
return tlist;
}
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)
{
var tlist = new List<function_node>();
tlist.Add(set_of_possible_functions[0]);
convert_function_call_expressions(tlist[0], parameters, tcll[0]);
return tlist;
}
}