Bladeren bron

Fix for Mantis #22433.

pdecsub.pas, parse_parameter_dec:
  * allow inline specialization for array types in mode Delphi

+ added test

git-svn-id: trunk@24207 -
svenbarth 12 jaren geleden
bovenliggende
commit
8353d53b69
3 gewijzigde bestanden met toevoegingen van 21 en 1 verwijderingen
  1. 1 0
      .gitattributes
  2. 6 1
      compiler/pdecsub.pas
  3. 14 0
      tests/webtbs/tw22433.pp

+ 1 - 0
.gitattributes

@@ -13223,6 +13223,7 @@ tests/webtbs/tw22344.pp svneol=native#text/plain
 tests/webtbs/tw2242.pp svneol=native#text/plain
 tests/webtbs/tw22427.pp svneol=native#text/pascal
 tests/webtbs/tw22428.pp svneol=native#text/pascal
+tests/webtbs/tw22433.pp svneol=native#text/pascal
 tests/webtbs/tw22490.pp svneol=native#text/plain
 tests/webtbs/tw2250.pp svneol=native#text/plain
 tests/webtbs/tw22502.pp svneol=native#text/plain

+ 6 - 1
compiler/pdecsub.pas

@@ -234,6 +234,7 @@ implementation
         explicit_paraloc,
         need_array,
         is_univ: boolean;
+        stoptions : TSingleTypeOptions;
 
         procedure handle_default_para_value;
           var
@@ -410,7 +411,11 @@ implementation
                 else
                  begin
                    { define field type }
-                   single_type(arrayelementdef,[]);
+                   if m_delphi in current_settings.modeswitches then
+                     stoptions:=[stoAllowSpecialization]
+                   else
+                     stoptions:=[];
+                   single_type(arrayelementdef,stoptions);
                    tarraydef(hdef).elementdef:=arrayelementdef;
                  end;
               end

+ 14 - 0
tests/webtbs/tw22433.pp

@@ -0,0 +1,14 @@
+{ %NORUN }
+
+program tw22433;
+
+{$MODE DELPHI}
+
+type TWrapper<T> = record end;
+
+procedure Z(const a: array of TWrapper<Integer>);
+begin
+end;
+
+begin
+end.