Browse Source

* State the purpose of the test.

Michaël Van Canneyt 4 months ago
parent
commit
2a30ef7aca
2 changed files with 7 additions and 1 deletions
  1. 4 1
      tests/test/tgeneric122.pp
  2. 3 0
      tests/test/tgeneric123.pp

+ 4 - 1
tests/test/tgeneric122.pp

@@ -1,5 +1,8 @@
 {$mode objfpc}
 {$mode objfpc}
 
 
+// test that the check on published property is performed during specialization
+// The below should work.
+
 type
 type
   {$M+}
   {$M+}
   generic myclass<T> = class
   generic myclass<T> = class
@@ -8,7 +11,7 @@ type
   published
   published
     property Data : T read FData;
     property Data : T read FData;
   end;
   end;
-  
+    
   TA = specialize myclass<integer>;
   TA = specialize myclass<integer>;
 //  TB = specialize myclass<text>;
 //  TB = specialize myclass<text>;
       
       

+ 3 - 0
tests/test/tgeneric123.pp

@@ -1,6 +1,9 @@
 {%FAIL}
 {%FAIL}
 {$mode objfpc}
 {$mode objfpc}
 
 
+// test that the check on published property is performed during specialization
+// The below should not work, since text is not a publishable type.
+
 type
 type
   {$M+}
   {$M+}
   generic myclass<T> = class
   generic myclass<T> = class