소스 검색

Fix for Mantis #29321.

pexpr.pas, postfixoperators:
  * also handle type helpers for static arrays

+ added test

git-svn-id: trunk@32845 -
svenbarth 9 년 전
부모
커밋
61b12af82b
3개의 변경된 파일32개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 0
      .gitattributes
  2. 7 6
      compiler/pexpr.pas
  3. 24 0
      tests/webtbs/tw29321.pp

+ 1 - 0
.gitattributes

@@ -14908,6 +14908,7 @@ tests/webtbs/tw2923.pp svneol=native#text/plain
 tests/webtbs/tw29250.pp svneol=native#text/pascal
 tests/webtbs/tw2926.pp svneol=native#text/plain
 tests/webtbs/tw2927.pp svneol=native#text/plain
+tests/webtbs/tw29321.pp svneol=native#text/pascal
 tests/webtbs/tw2942a.pp svneol=native#text/plain
 tests/webtbs/tw2942b.pp svneol=native#text/plain
 tests/webtbs/tw2943.pp svneol=native#text/plain

+ 7 - 6
compiler/pexpr.pas

@@ -2369,12 +2369,13 @@ implementation
                            end;
                        end
                      else
-                       begin
-                         Message(parser_e_invalid_qualifier);
-                         p1.destroy;
-                         p1:=cerrornode.create;
-                         consume(_ID);
-                       end;
+                       if (token<>_ID) or not try_type_helper(p1,nil) then
+                         begin
+                           Message(parser_e_invalid_qualifier);
+                           p1.destroy;
+                           p1:=cerrornode.create;
+                           consume(_ID);
+                         end;
                    end;
                   variantdef:
                     begin

+ 24 - 0
tests/webtbs/tw29321.pp

@@ -0,0 +1,24 @@
+{ %NORUN }
+
+program tw29321;
+
+{$mode objfpc}
+{$modeswitch typehelpers}
+
+type
+  TVector = array[0..2] of Single;
+  
+  TVectorHelper = type helper for TVector
+  public
+    procedure Add;
+  end;
+
+procedure TVectorHelper.Add;
+begin
+end;
+
+var
+  v: TVector;
+begin
+  v.Add;
+end.