Jonas Maebe 24 years ago
parent
commit
fd458f8f15
1 changed files with 32 additions and 0 deletions
  1. 32 0
      tests/webtbf/tw1642.pp

+ 32 - 0
tests/webtbf/tw1642.pp

@@ -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.
+