pascalabcnet/TestSuite/property11.pas
Ivan Bondarev 4165e1860f #2885
2023-07-02 20:48:21 +02:00

20 lines
456 B
ObjectPascal

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.