This commit is contained in:
parent
494b47624d
commit
45fdde24b4
21
TestSuite/implicitexplicit28.pas
Normal file
21
TestSuite/implicitexplicit28.pas
Normal 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.
|
||||||
|
|
@ -2883,6 +2883,7 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
{
|
{
|
||||||
var tlist = new List<function_node>();
|
var tlist = new List<function_node>();
|
||||||
tlist.Add(f2);
|
tlist.Add(f2);
|
||||||
|
convert_function_call_expressions(tlist[0], parameters, tcll[0]);
|
||||||
return tlist;
|
return tlist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2960,6 +2961,7 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
set_of_possible_functions.Remove(fn);
|
set_of_possible_functions.Remove(fn);
|
||||||
var tlist = new List<function_node>();
|
var tlist = new List<function_node>();
|
||||||
tlist.Add(set_of_possible_functions[0]);
|
tlist.Add(set_of_possible_functions[0]);
|
||||||
|
convert_function_call_expressions(tlist[0], parameters, tcll[0]);
|
||||||
return tlist;
|
return tlist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2969,12 +2971,14 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
{
|
{
|
||||||
var tlist = new List<function_node>();
|
var tlist = new List<function_node>();
|
||||||
tlist.Add(set_of_possible_functions[1]);
|
tlist.Add(set_of_possible_functions[1]);
|
||||||
|
convert_function_call_expressions(tlist[0], parameters, tcll[0]);
|
||||||
return tlist;
|
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)
|
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>();
|
var tlist = new List<function_node>();
|
||||||
tlist.Add(set_of_possible_functions[0]);
|
tlist.Add(set_of_possible_functions[0]);
|
||||||
|
convert_function_call_expressions(tlist[0], parameters, tcll[0]);
|
||||||
return tlist;
|
return tlist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue