Browse Source

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

+ added test

git-svn-id: trunk@27897 -
svenbarth 11 years ago
parent
commit
8b290f4cb2
2 changed files with 56 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 55 0
      tests/webtbs/tw24690.pp

+ 1 - 0
.gitattributes

@@ -13875,6 +13875,7 @@ tests/webtbs/tw24536.pp svneol=native#text/plain
 tests/webtbs/tw2454.pp svneol=native#text/plain
 tests/webtbs/tw24540.pp svneol=native#text/plain
 tests/webtbs/tw24651.pp svneol=native#text/pascal
+tests/webtbs/tw24690.pp svneol=native#text/pascal
 tests/webtbs/tw24705.pp svneol=native#text/pascal
 tests/webtbs/tw2473.pp svneol=native#text/plain
 tests/webtbs/tw2480.pp svneol=native#text/plain

+ 55 - 0
tests/webtbs/tw24690.pp

@@ -0,0 +1,55 @@
+unit tw24690;
+
+{$mode objfpc}{$H+}
+
+interface
+
+type
+  generic TMyGenericType<_T> = class
+  public
+  end;
+
+  { TMyClass }
+
+  generic TMyClass<_T> = class
+  public
+    type
+      TMyGenericTypeSpec = specialize TMyGenericType<_T>;
+
+  public
+    procedure Test;
+  end;
+
+  { TMyClass2 }
+
+  generic TMyClass2<_T> = class
+  public
+    type
+      TMyClassSpec = specialize TMyClass<Integer>;
+
+  public
+    procedure Test2;
+  end;
+
+implementation
+
+{ TMyClass2 }
+
+procedure TMyClass2.Test2;
+var
+  Enum: TMyClassSpec.TMyGenericTypeSpec; //Error: Error in type definition
+begin
+  Enum := TMyClassSpec.TMyGenericTypeSpec.Create;
+  Enum.Destroy;
+end;
+
+{ TMyClass }
+
+procedure TMyClass.Test;
+begin
+
+end;
+
+
+end.
+