Browse Source

Merged revisions 7321-7322 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r7321 | peter | 2007-05-13 00:16:06 +0200 (Sun, 13 May 2007) | 2 lines

* set symoptions for all implicit created parameters

........
r7322 | peter | 2007-05-13 00:16:58 +0200 (Sun, 13 May 2007) | 2 lines

* test for parameter symoptions

........

git-svn-id: branches/fixes_2_2@7341 -

peter 18 years ago
parent
commit
bc9cf6c6a5
3 changed files with 41 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 6 0
      compiler/pdecsub.pas
  3. 34 0
      tests/webtbs/tw8861.pp

+ 1 - 0
.gitattributes

@@ -8089,6 +8089,7 @@ tests/webtbs/tw8660.pp svneol=native#text/plain
 tests/webtbs/tw8664.pp svneol=native#text/plain
 tests/webtbs/tw8757.pp svneol=native#text/plain
 tests/webtbs/tw8838.pp svneol=native#text/plain
+tests/webtbs/tw8861.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 6 - 0
compiler/pdecsub.pas

@@ -107,6 +107,7 @@ implementation
              paranr:=paranr_result;
            { Generate result variable accessing function result }
            vs:=tparavarsym.create('$result',paranr,vs_var,pd.returndef,[vo_is_funcret,vo_is_hidden_para]);
+           vs.symoptions:=[sp_public];
            pd.parast.insert(vs);
            { Store the this symbol as funcretsym for procedures }
            if pd.typ=procdef then
@@ -134,6 +135,7 @@ implementation
             vs:=tparavarsym.create('$parentfp',paranr_parentfp,vs_value
                   ,voidpointertype,[vo_is_parentfp,vo_is_hidden_para]);
             vs.varregable:=vr_none;
+            vs.symoptions:=[sp_public];
             pd.parast.insert(vs);
 
             current_tokenpos:=storepos;
@@ -153,6 +155,7 @@ implementation
           begin
             { Generate self variable }
             vs:=tparavarsym.create('$self',paranr_self,vs_value,voidpointertype,[vo_is_self,vo_is_hidden_para]);
+            vs.symoptions:=[sp_public];
             pd.parast.insert(vs);
           end
         else
@@ -170,6 +173,7 @@ implementation
                    { can't use classrefdef as type because inheriting
                      will then always file because of a type mismatch }
                    vs:=tparavarsym.create('$vmt',paranr_vmt,vs_value,voidpointertype,[vo_is_vmt,vo_is_hidden_para]);
+                   vs.symoptions:=[sp_public];
                    pd.parast.insert(vs);
                  end;
 
@@ -187,6 +191,7 @@ implementation
                     hdef:=tprocdef(pd)._class;
                   end;
                 vs:=tparavarsym.create('$self',paranr_self,vsp,hdef,[vo_is_self,vo_is_hidden_para]);
+                vs.symoptions:=[sp_public];
                 pd.parast.insert(vs);
 
                 current_tokenpos:=storepos;
@@ -271,6 +276,7 @@ implementation
            if paramanager.push_high_param(varspez,vardef,pd.proccalloption) then
              begin
                hvs:=tparavarsym.create('$high'+name,paranr+1,vs_const,sinttype,[vo_is_high_para,vo_is_hidden_para]);
+               hvs.symoptions:=[sp_public];
                owner.insert(hvs);
              end
            else

+ 34 - 0
tests/webtbs/tw8861.pp

@@ -0,0 +1,34 @@
+{$mode objfpc}{$H+}
+
+uses
+ Classes, SysUtils
+  { add your units here };
+
+type
+  TNotifyEventExt = procedure(ASender: TObject; ANotifyType: integer) of
+object;
+
+  TNotify = class
+  strict private
+    FOnNotify: TNotifyEventExt;
+  strict  protected
+    procedure test;
+  public
+    constructor Create;
+  end;
+
+
+constructor TNotify.Create;
+begin
+  inherited Create;
+  FOnNotify := nil;
+end;
+
+procedure TNotify.test;
+begin
+   FOnNotify(nil, 0); //project1.pas(30,13) Fatal: Syntax error, ";" expected but "(" found
+end;
+
+begin
+end.
+