Browse Source

Mantis #25236 was fixed by partial specializations addition in revision 27861

+ added test

git-svn-id: trunk@27902 -
svenbarth 11 years ago
parent
commit
81c7b22199
2 changed files with 27 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 26 0
      tests/webtbs/tw25236.pp

+ 1 - 0
.gitattributes

@@ -13912,6 +13912,7 @@ tests/webtbs/tw25169.pp svneol=native#text/plain
 tests/webtbs/tw25170.pp svneol=native#text/plain
 tests/webtbs/tw25198.pp svneol=native#text/plain
 tests/webtbs/tw25210.pp svneol=native#text/pascal
+tests/webtbs/tw25236.pp svneol=native#text/pascal
 tests/webtbs/tw2525.pp svneol=native#text/plain
 tests/webtbs/tw25255.pp svneol=native#text/pascal
 tests/webtbs/tw25269.pp svneol=native#text/pascal

+ 26 - 0
tests/webtbs/tw25236.pp

@@ -0,0 +1,26 @@
+{ %NORUN }
+
+program tw25236;
+
+{$mode delphi}
+
+type
+  TCompare<T> = function(const A, B: T): Integer;
+
+  TList<T> = class
+  public
+    type TListCompare = TCompare<T>;
+  private
+    {$define bug}
+    {$ifdef bug}
+    {Error: Generics without specialization cannot be used as a type for a variable}
+    FComparer: TListCompare;
+    {$else}
+    FComparer: TCompare<T>;
+    {$endif}
+  public
+    property Comparer: TListCompare read FComparer write FComparer;
+  end;
+
+begin
+end.