Przeglądaj źródła

+ add test for Mantis #23702, just to be sure that we don't re-add that already solved problem

git-svn-id: trunk@35335 -
svenbarth 8 lat temu
rodzic
commit
4742e826f6
2 zmienionych plików z 25 dodań i 0 usunięć
  1. 1 0
      .gitattributes
  2. 24 0
      tests/webtbf/tw23702.pp

+ 1 - 0
.gitattributes

@@ -13751,6 +13751,7 @@ tests/webtbf/tw23571b.pp svneol=native#text/pascal
 tests/webtbf/tw23571c.pp svneol=native#text/pascal
 tests/webtbf/tw23571c.pp svneol=native#text/pascal
 tests/webtbf/tw2359.pp svneol=native#text/plain
 tests/webtbf/tw2359.pp svneol=native#text/plain
 tests/webtbf/tw2362.pp svneol=native#text/plain
 tests/webtbf/tw2362.pp svneol=native#text/plain
+tests/webtbf/tw23702.pp svneol=native#text/pascal
 tests/webtbf/tw2383.pp svneol=native#text/plain
 tests/webtbf/tw2383.pp svneol=native#text/plain
 tests/webtbf/tw2400.pp svneol=native#text/plain
 tests/webtbf/tw2400.pp svneol=native#text/plain
 tests/webtbf/tw24013.pp svneol=native#text/plain
 tests/webtbf/tw24013.pp svneol=native#text/plain

+ 24 - 0
tests/webtbf/tw23702.pp

@@ -0,0 +1,24 @@
+{ %FAIL }
+
+{$mode objfpc}
+unit tw23702;
+{ Unit to demonstrate that free pascal does not complain
+  when generic types promise to implement an interface but
+  then do not. }
+interface
+
+  type
+    IFoo = interface
+      function foo : byte;
+    end;
+
+    generic GBar<t> = class( TInterfacedObject, IFoo )
+      // does not implement foo, but compiler doesn't care.
+    end;
+
+    {TBar = class( TInterfacedObject, IFoo )
+      // does not implement foo, and compiler complains
+    end;}
+
+implementation
+end.