summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-04-26 11:46:10 +0000
committersvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-04-26 11:46:10 +0000
commit02e430375acc90a467c7d3c054762c2a38315a13 (patch)
tree9349276cbb1f118eed4ff70737f921591b03efc3
parentd80aeb130697e8615cb90ff2d25a3fc6d38ac7bf (diff)
downloadfpc-02e430375acc90a467c7d3c054762c2a38315a13.tar.gz
* 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: https://svn.freepascal.org/svn/fpc/trunk@45089 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/pgenutil.pas2
-rw-r--r--tests/webtbf/tw36975.pp10
2 files changed, 11 insertions, 1 deletions
diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas
index e73f112fa9..57b69f2dc7 100644
--- a/compiler/pgenutil.pas
+++ b/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;
diff --git a/tests/webtbf/tw36975.pp b/tests/webtbf/tw36975.pp
new file mode 100644
index 0000000000..ce3a43da36
--- /dev/null
+++ b/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.