Browse Source

* allow local type definitions for "file of xx" component types
(mantis #20527)

git-svn-id: trunk@19524 -

Jonas Maebe 13 years ago
parent
commit
a228b211c4
3 changed files with 12 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/ptype.pas
  3. 10 0
      tests/webtbs/tw20527.pp

+ 1 - 0
.gitattributes

@@ -11918,6 +11918,7 @@ tests/webtbs/tw2041.pp svneol=native#text/plain
 tests/webtbs/tw20421.pp svneol=native#text/pascal
 tests/webtbs/tw2045.pp svneol=native#text/plain
 tests/webtbs/tw2046a.pp svneol=native#text/plain
+tests/webtbs/tw20527.pp svneol=native#text/plain
 tests/webtbs/tw2059.pp svneol=native#text/plain
 tests/webtbs/tw2065.pp svneol=native#text/plain
 tests/webtbs/tw2069.pp svneol=native#text/plain

+ 1 - 1
compiler/ptype.pas

@@ -586,7 +586,7 @@ implementation
                          if not(stoAllowTypeDef in options) then
                            Message(parser_e_no_local_para_def);
                          consume(_OF);
-                         single_type(t2,[]);
+                         single_type(t2,[stoAllowTypeDef]);
                          if is_managed_type(t2) then
                            Message(parser_e_no_refcounted_typed_file);
                          def:=tfiledef.createtyped(t2);

+ 10 - 0
tests/webtbs/tw20527.pp

@@ -0,0 +1,10 @@
+{ %norun }
+
+type
+  s = string[10];
+Var
+  fos: file of s;
+  aos: array[char]of string[63];
+  fosx: File of String[63]; (* become bad *)
+Begin
+end.