Browse Source

+ add test for Mantis #19511 which seems to be fixed already...

git-svn-id: trunk@21315 -
svenbarth 13 years ago
parent
commit
fb3777b9a0
2 changed files with 25 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 24 0
      tests/webtbs/tw19511.pp

+ 1 - 0
.gitattributes

@@ -12480,6 +12480,7 @@ tests/webtbs/tw1948.pp svneol=native#text/plain
 tests/webtbs/tw19498.pp svneol=native#text/pascal
 tests/webtbs/tw19498.pp svneol=native#text/pascal
 tests/webtbs/tw1950.pp svneol=native#text/plain
 tests/webtbs/tw1950.pp svneol=native#text/plain
 tests/webtbs/tw19500.pp svneol=native#text/pascal
 tests/webtbs/tw19500.pp svneol=native#text/pascal
+tests/webtbs/tw19511.pp svneol=native#text/pascal
 tests/webtbs/tw19548.pp svneol=native#text/pascal
 tests/webtbs/tw19548.pp svneol=native#text/pascal
 tests/webtbs/tw19555.pp svneol=native#text/pascal
 tests/webtbs/tw19555.pp svneol=native#text/pascal
 tests/webtbs/tw1964.pp svneol=native#text/plain
 tests/webtbs/tw1964.pp svneol=native#text/plain

+ 24 - 0
tests/webtbs/tw19511.pp

@@ -0,0 +1,24 @@
+{ %NORUN }
+
+{$MODE OBJFPC} { -*- text -*- }
+program tw19511;
+
+type
+   generic TFoo<X> = class
+   end;
+   generic TBar<Y> = class
+    type
+     TIntegerSpecializedFoo = specialize TFoo<Integer>;
+     TSelfSpecializedFoo = specialize TFoo<TBar>;
+    function SelfTest(): TBar; // returns a TBar<Y>
+      TSpecializedBar = specialize TBar<Y>; // this rightly would not compile since TBar here refers to the specialized TBar<Y>
+   end;
+
+function TBar.SelfTest(): TBar;
+begin
+   Result := Self;
+end;
+
+begin
+end. 
+