Browse Source

* check for procvar in valid_for_formal

peter 25 years ago
parent
commit
8ab40df69d
1 changed files with 22 additions and 7 deletions
  1. 22 7
      compiler/htypechk.pas

+ 22 - 7
compiler/htypechk.pas

@@ -846,10 +846,15 @@ implementation
            v:=true;
            v:=true;
          calln : { procvars are callnodes first }
          calln : { procvars are callnodes first }
            v:=assigned(p^.right) and not assigned(p^.left);
            v:=assigned(p^.right) and not assigned(p^.left);
-         addrn,
-         typen : { addrn is not allowed as this generate a constant value (PFV) }
-           v:=false;
-         { no other node accepted (PM) }
+         addrn :
+           begin
+             { addrn is not allowed as this generate a constant value,
+               but a tp procvar are allowed (PFV) }
+             if p^.procvarload then
+              v:=true
+             else
+              v:=false;
+           end;
          else
          else
            v:=false;
            v:=false;
         end;
         end;
@@ -865,8 +870,15 @@ implementation
         case p^.treetype of
         case p^.treetype of
           calln,
           calln,
           statementn,
           statementn,
-          addrn : { addrn is not allowed as this generate a constant value and not a reference (PFV) }
-            v:=false;
+          addrn :
+           begin
+             { addrn is not allowed as this generate a constant value,
+               but a tp procvar are allowed (PFV) }
+             if p^.procvarload then
+              v:=true
+             else
+              v:=false;
+           end;
           else
           else
             v:=true;
             v:=true;
         end;
         end;
@@ -1077,7 +1089,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.65  2000-06-02 21:22:04  pierre
+  Revision 1.66  2000-06-04 09:04:30  peter
+    * check for procvar in valid_for_formal
+
+  Revision 1.65  2000/06/02 21:22:04  pierre
     + isbinaryoperatoracceptable and isunaryoperatoracceptable
     + isbinaryoperatoracceptable and isunaryoperatoracceptable
       for a more coherent operator overloading implementation
       for a more coherent operator overloading implementation
       tok2node moved from pexpr unit to htypechk
       tok2node moved from pexpr unit to htypechk