Browse Source

* fix for Mantis #35348: correctly handle symbols that aren't parameter types (e.g. default values)
+ added test

git-svn-id: trunk@41869 -

svenbarth 6 years ago
parent
commit
e6add40495
3 changed files with 19 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 5 1
      compiler/htypechk.pas
  3. 13 0
      tests/webtbf/tw35348.pp

+ 1 - 0
.gitattributes

@@ -14843,6 +14843,7 @@ tests/webtbf/tw3488.pp svneol=native#text/plain
 tests/webtbf/tw3495.pp svneol=native#text/plain
 tests/webtbf/tw3502.pp svneol=native#text/plain
 tests/webtbf/tw35149a.pp svneol=native#text/plain
+tests/webtbf/tw35348.pp svneol=native#text/pascal
 tests/webtbf/tw3553.pp svneol=native#text/plain
 tests/webtbf/tw3562.pp svneol=native#text/plain
 tests/webtbf/tw3583.pp svneol=native#text/plain

+ 5 - 1
compiler/htypechk.pas

@@ -627,7 +627,11 @@ implementation
         while count > 0 do
           begin
             parasym:=tparavarsym(pf.parast.SymList[count-1]);
-            if is_boolean(parasym.vardef) then
+            if parasym.typ<>paravarsym then
+              begin
+                dec(count);
+              end
+            else if is_boolean(parasym.vardef) then
               begin
                 if parasym.name='RANGECHECK' then
                   begin

+ 13 - 0
tests/webtbf/tw35348.pp

@@ -0,0 +1,13 @@
+{ %FAIL }
+
+{$mode objfpc}{$H+}
+
+Type
+  TAZ=String;
+
+operator inc(az: TAZ; i: integer=1) raz:TAZ; // inline;
+begin
+end;
+
+begin
+end.