Browse Source

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

+ added test

git-svn-id: trunk@27898 -
svenbarth 11 years ago
parent
commit
1ebff1a963
2 changed files with 28 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 27 0
      tests/webtbs/tw21622.pp

+ 1 - 0
.gitattributes

@@ -13728,6 +13728,7 @@ tests/webtbs/tw21593.pp svneol=native#text/pascal
 tests/webtbs/tw21593a.pp svneol=native#text/pascal
 tests/webtbs/tw21593b.pp svneol=native#text/pascal
 tests/webtbs/tw21593c.pp svneol=native#text/pascal
+tests/webtbs/tw21622.pp svneol=native#text/pascal
 tests/webtbs/tw2163.pp svneol=native#text/plain
 tests/webtbs/tw21654.pp svneol=native#text/pascal
 tests/webtbs/tw21674.pp svneol=native#text/pascal

+ 27 - 0
tests/webtbs/tw21622.pp

@@ -0,0 +1,27 @@
+{ %NORUN }
+
+program tw21622;
+
+{$MODE DELPHI}
+{$DEFINE CAUSE_ERROR}
+
+type
+  TProceduralMethod<T> = procedure (arg: T) of object;
+
+  TWrapper<T> = class
+  strict private
+    type
+      TOnChanging = TProceduralMethod<T>;
+      { Replace T with e.g. Integer, the problem persists }
+  strict private
+  {$IFDEF CAUSE_ERROR}
+    FOnChanging: TOnChanging;
+      { Error: Generics without specialization cannot be used as a type for
+        a variable }
+  {$ELSE}
+    FOnChanging: TProceduralMethod<T>;
+  {$ENDIF}
+  end;
+
+begin
+end.