This commit is contained in:
Ivan Bondarev 2020-12-27 18:55:19 +01:00
parent b65758270c
commit 840c6637d0
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,9 @@
function operator=<T>(a,b: array of T): boolean; extensionmethod :=
(a.Length=b.Length) and a.SequenceEqual(b);
begin
var a := Arr(1,2,3);
var b := Arr(1,2,3);
Assert(not object.ReferenceEquals(a,b));
Assert(a = b);
end.

View file

@ -3456,7 +3456,7 @@ namespace PascalABCCompiler.TreeRealization
List<SymbolInfo> sil2 = find_in_additional_names(name);
List<SymbolInfo> sil3 = compiled_find(name);
bool clone = false;
if (!no_search_in_extension_methods || this._compiled_type.IsGenericType)
if (!no_search_in_extension_methods || this._compiled_type.IsGenericType || this.type_special_kind == SemanticTree.type_special_kind.array_kind)
{
if (this.type_special_kind == SemanticTree.type_special_kind.array_kind && this.base_type.Scope != null)