This commit is contained in:
Ivan Bondarev 2021-04-05 15:33:16 +02:00
parent ff55c29fee
commit 13c677e66e
2 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,16 @@
function operator=<T>(x,y: Stack<T>): boolean; extensionmethod;
begin
Result := True
end;
function operator<><T>(x,y: Stack<T>): boolean; extensionmethod;
begin
Result := not(x = y);
end;
begin
var a1 := new Stack<integer>;
var a2 := new Stack<integer>;
assert(a1 = a2);
assert(not (a1 <> a2));
end.

View file

@ -2091,7 +2091,14 @@ namespace PascalABCCompiler.TreeRealization
private void conform_basic_function(string name, int base_func_num)
{
SymbolInfo si1 = _original_generic.find_first_in_type(name, true);
SymbolInfo si1 = null;
List<SymbolInfo> sil = _original_generic.find_in_type(name, true);
foreach (SymbolInfo si in sil)
if (si.sym_info is function_node && !(si.sym_info as function_node).is_extension_method)
{
si1 = si;
break;
}
AddMember(si1.sym_info, temp_names[base_func_num].sym_info);
}