Browse Source

* don't allow starting new virtual trees in TP-style objects + test
* fixed bug in whlpview.pas where such an new tree was unintentially
started

git-svn-id: trunk@8422 -

Jonas Maebe 18 years ago
parent
commit
288a538df5
7 changed files with 191 additions and 165 deletions
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/msg/errore.msg
  3. 1 1
      compiler/msgidx.inc
  4. 157 157
      compiler/msgtxt.inc
  5. 5 1
      compiler/nobj.pas
  6. 4 4
      ide/whlpview.pas
  7. 21 0
      tests/webtbf/tw9306c.pp

+ 1 - 0
.gitattributes

@@ -7443,6 +7443,7 @@ tests/webtbf/tw9039b.pp svneol=native#text/plain
 tests/webtbf/tw9039c.pp svneol=native#text/plain
 tests/webtbf/tw9039c.pp svneol=native#text/plain
 tests/webtbf/tw9039d.pp svneol=native#text/plain
 tests/webtbf/tw9039d.pp svneol=native#text/plain
 tests/webtbf/tw9225.pp svneol=native#text/plain
 tests/webtbf/tw9225.pp svneol=native#text/plain
+tests/webtbf/tw9306c.pp svneol=native#text/plain
 tests/webtbf/tw9499.pp svneol=native#text/plain
 tests/webtbf/tw9499.pp svneol=native#text/plain
 tests/webtbf/tw9499a.pp svneol=native#text/plain
 tests/webtbf/tw9499a.pp svneol=native#text/plain
 tests/webtbf/tw9522.pp svneol=native#text/plain
 tests/webtbf/tw9522.pp svneol=native#text/plain

+ 2 - 2
compiler/msg/errore.msg

@@ -429,7 +429,7 @@ parser_e_overloaded_have_same_parameters=03028_E_overloaded functions have the s
 % You're declaring overloaded functions, but with the same parameter list.
 % You're declaring overloaded functions, but with the same parameter list.
 % Overloaded function must have at least 1 different parameter in their
 % Overloaded function must have at least 1 different parameter in their
 % declaration.
 % declaration.
-parser_e_header_dont_match_forward=03029_E_function header doesn't match the forward declaration "$1"
+parser_e_header_dont_match_forward=03029_E_function header doesn't match the previous declaration "$1"
 % You declared a function with same parameters but
 % You declared a function with same parameters but
 % different result type or function modifiers.
 % different result type or function modifiers.
 parser_e_header_different_var_names=03030_E_function header "$1" doesn't match forward : var name changes $2 => $3
 parser_e_header_different_var_names=03030_E_function header "$1" doesn't match forward : var name changes $2 => $3
@@ -2656,7 +2656,7 @@ S*2Tlinux_Linux
 **2*_a : Show everything             x : Executable info (Win32 only)
 **2*_a : Show everything             x : Executable info (Win32 only)
 **2*_b : Write file names messages with full path
 **2*_b : Write file names messages with full path
 **2*_v : Write fpcdebug.txt with     p : Write tree.log with parse tree
 **2*_v : Write fpcdebug.txt with     p : Write tree.log with parse tree
-**2*_    Lots of debugging info
+**2*_    lots of debugging info
 3*1W<x>_Target-specific options (targets)
 3*1W<x>_Target-specific options (targets)
 A*1W<x>_Target-specific options (targets)
 A*1W<x>_Target-specific options (targets)
 P*1W<x>_Target-specific options (targets)
 P*1W<x>_Target-specific options (targets)

+ 1 - 1
compiler/msgidx.inc

@@ -731,7 +731,7 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 45147;
+  MsgTxtSize = 45148;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
     24,86,237,83,63,49,107,22,135,60,
     24,86,237,83,63,49,107,22,135,60,

File diff suppressed because it is too large
+ 157 - 157
compiler/msgtxt.inc


+ 5 - 1
compiler/nobj.pas

@@ -371,7 +371,11 @@ implementation
                           if (pd._class=procdefcoll^.data._class) then
                           if (pd._class=procdefcoll^.data._class) then
                             MessagePos(pd.fileinfo,parser_e_overloaded_have_same_parameters)
                             MessagePos(pd.fileinfo,parser_e_overloaded_have_same_parameters)
                           else if (_class=pd._class) and not(po_reintroduce in pd.procoptions) then
                           else if (_class=pd._class) and not(po_reintroduce in pd.procoptions) then
-                            MessagePos1(pd.fileinfo,parser_w_should_use_override,pd.fullprocname(false));
+                            if not is_object(_class) then
+                              MessagePos1(pd.fileinfo,parser_w_should_use_override,pd.fullprocname(false))
+                            else
+                              { objects don't allow starting a new virtual tree }
+                              MessagePos1(pd.fileinfo,parser_e_header_dont_match_forward,procdefcoll^.data.fullprocname(false));
                         end;
                         end;
                      end;
                      end;
                   end
                   end

+ 4 - 4
ide/whlpview.pas

@@ -102,7 +102,7 @@ type
       PLinePosCollection = ^TLinePosCollection;
       PLinePosCollection = ^TLinePosCollection;
       TLinePosCollection = object(TNoDisposeCollection)
       TLinePosCollection = object(TNoDisposeCollection)
         function At(Index: sw_Integer): sw_integer;
         function At(Index: sw_Integer): sw_integer;
-        procedure Insert (Item: ptrint);virtual;
+        procedure Insert (Item: pointer);virtual;
       end;
       end;
 
 
       PHelpTopic = ^THelpTopic;
       PHelpTopic = ^THelpTopic;
@@ -402,9 +402,9 @@ begin
   at := longint (inherited at(Index));
   at := longint (inherited at(Index));
 end;
 end;
 
 
-procedure TLinePosCollection.Insert (Item: ptrint);
+procedure TLinePosCollection.Insert (Item: pointer);
 begin
 begin
-  Inherited Insert(pointer(Item));
+  Inherited Insert(Item);
 end;
 end;
 
 
 constructor THelpTopic.Init(ATopic: PTopic);
 constructor THelpTopic.Init(ATopic: PTopic);
@@ -482,7 +482,7 @@ begin
       Bounds.Move(Delta,0);
       Bounds.Move(Delta,0);
   if Line='' then Line:=' ';
   if Line='' then Line:=' ';
   Lines^.Insert(NewStr(Line));
   Lines^.Insert(NewStr(Line));
-  LinesPos^.Insert(LinePos);
+  LinesPos^.Insert(pointer(LinePos));
   ClearLine;
   ClearLine;
   LineStart:=NextLineStart;
   LineStart:=NextLineStart;
   CurPos.X:=Margin+LineStart; Line:=CharStr(#255,LineStart); Inc(CurPos.Y);
   CurPos.X:=Margin+LineStart; Line:=CharStr(#255,LineStart); Inc(CurPos.Y);

+ 21 - 0
tests/webtbf/tw9306c.pp

@@ -0,0 +1,21 @@
+{ %fail }
+
+type
+  tobj = object
+    function f: integer; virtual;
+  end;
+
+  tobj2 = object(tobj)
+    function f: string; virtual;
+  end;
+
+  function tobj.f: integer;
+    begin
+    end;
+
+  function tobj2.f:string;
+    begin
+    end;
+
+begin
+end.

Some files were not shown because too many files changed in this diff