This commit is contained in:
Ivan Bondarev 2023-07-02 20:48:21 +02:00
parent 7c5ba9f83a
commit 4165e1860f
2 changed files with 32 additions and 0 deletions

20
TestSuite/property11.pas Normal file
View file

@ -0,0 +1,20 @@
type
t1<T> = class(System.IEquatable<t1<T>>)
public property Item[ind: integer]: integer read 1; default;
public static procedure p1;
begin
var a := new t1<T>;
//Ошибка: Нет индексного свойства по умолчанию для типа t1<T>
var x := a[0];
assert(x = 1);
end;
public function Equals(other: t1<T>) := true;
end;
begin
t1&<integer>.p1;
end.

View file

@ -1626,6 +1626,18 @@ namespace PascalABCCompiler.TreeRealization
}
}
public override property_node default_property_node
{
get
{
if (default_property != null)
return default_property;
if (original_generic.default_property_node != null)
default_property = ConvertMember(original_generic.default_property_node) as common_property_node;
return default_property;
}
}
private List<SymbolInfo> temp_names = new List<SymbolInfo>(3);
public override void add_name(string name, SymbolInfo si)