This commit is contained in:
parent
7c5ba9f83a
commit
4165e1860f
20
TestSuite/property11.pas
Normal file
20
TestSuite/property11.pas
Normal 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.
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue