Browse Source

* fix for Mantis #36975: arraydefs are not allowed for generic types (this is only used for type declarations; for specializing constant strings which are char arrays are still allowed)
+ added test

git-svn-id: trunk@45089 -

svenbarth 5 năm trước cách đây
mục cha
commit
a467332187
3 tập tin đã thay đổi với 12 bổ sung1 xóa
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/pgenutil.pas
  3. 10 0
      tests/webtbf/tw36975.pp

+ 1 - 0
.gitattributes

@@ -16380,6 +16380,7 @@ tests/webtbf/tw36631b.pp svneol=native#text/pascal
 tests/webtbf/tw36652.pp svneol=native#text/pascal
 tests/webtbf/tw36720.pp svneol=native#text/pascal
 tests/webtbf/tw3680.pp svneol=native#text/plain
+tests/webtbf/tw36975.pp svneol=native#text/pascal
 tests/webtbf/tw3716.pp svneol=native#text/plain
 tests/webtbf/tw3738.pp svneol=native#text/plain
 tests/webtbf/tw3740.pp svneol=native#text/plain

+ 1 - 1
compiler/pgenutil.pas

@@ -78,7 +78,7 @@ uses
   type
     tdeftypeset = set of tdeftyp;
   const
-    tgeneric_param_const_types : tdeftypeset = [orddef,stringdef,arraydef,floatdef,setdef,pointerdef,enumdef];
+    tgeneric_param_const_types : tdeftypeset = [orddef,stringdef,floatdef,setdef,pointerdef,enumdef];
     tgeneric_param_nodes : tnodetypeset = [typen,ordconstn,stringconstn,realconstn,setconstn,niln];
 
     function get_generic_param_def(sym:tsym):tdef;

+ 10 - 0
tests/webtbf/tw36975.pp

@@ -0,0 +1,10 @@
+{ %FAIL }
+program tw36975;
+
+{$mode objfpc}{$H+}
+type
+  generic TTest <T,const N:Tintegerarray> = class
+  end;
+
+begin
+end.