Browse Source

* remove procedures with var/out parameters which are supposed to
be passed a constant expression from the overload candidates

git-svn-id: trunk@9050 -

Jonas Maebe 18 years ago
parent
commit
e621b30af8
1 changed files with 6 additions and 3 deletions
  1. 6 3
      compiler/htypechk.pas

+ 6 - 3
compiler/htypechk.pas

@@ -1413,7 +1413,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure var_para_allowed(var eq:tequaltype;def_from,def_to:Tdef);
+    procedure var_para_allowed(var eq:tequaltype;def_from,def_to:Tdef; fromnode: tnode);
       begin
       begin
         { Note: eq must be already valid, it will only be updated! }
         { Note: eq must be already valid, it will only be updated! }
         case def_to.typ of
         case def_to.typ of
@@ -1421,7 +1421,10 @@ implementation
             begin
             begin
               { all types can be passed to a formaldef,
               { all types can be passed to a formaldef,
                 but it is not the prefered way }
                 but it is not the prefered way }
-              eq:=te_convert_l2;
+              if not is_constnode(fromnode) then
+                eq:=te_convert_l2
+              else
+                eq:=te_incompatible;
             end;
             end;
           orddef :
           orddef :
             begin
             begin
@@ -2104,7 +2107,7 @@ implementation
                         eq:=te_incompatible;
                         eq:=te_incompatible;
                         { var_para_allowed will return te_equal and te_convert_l1 to
                         { var_para_allowed will return te_equal and te_convert_l1 to
                           make a difference for best matching }
                           make a difference for best matching }
-                        var_para_allowed(eq,currpt.resultdef,currpara.vardef)
+                        var_para_allowed(eq,currpt.resultdef,currpara.vardef,currpt.left)
                       end
                       end
                     else
                     else
                       para_allowed(eq,currpt,def_to);
                       para_allowed(eq,currpt,def_to);