mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 04:07:17 +01:00
+added
This commit is contained in:
parent
daa7693b45
commit
fd458f8f15
32
tests/webtbf/tw1642.pp
Normal file
32
tests/webtbf/tw1642.pp
Normal file
@ -0,0 +1,32 @@
|
||||
{ %FAIL }
|
||||
program TestDefaultProperty;
|
||||
|
||||
{$MODE OBJFPC}{$H+}
|
||||
|
||||
uses
|
||||
SysUtils;
|
||||
|
||||
type
|
||||
TMyClass = class
|
||||
private
|
||||
function GetItems(Index: integer): integer;
|
||||
public
|
||||
property Items[Index: integer]: integer read GetItems; default;
|
||||
end;
|
||||
|
||||
function TMyClass.GetItems(Index: integer): integer;
|
||||
begin
|
||||
writeln('Get Index=',Index);
|
||||
Result:=Index;
|
||||
end;
|
||||
|
||||
var MyClass: TMyClass;
|
||||
i: integer;
|
||||
|
||||
begin
|
||||
MyClass:=TMyClass.Create;
|
||||
i:=MyClass.Items;
|
||||
writeln('i=',i);
|
||||
MyClass.Free;
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user