Browse Source

* allow passing read-only typedconsts to const parameters

git-svn-id: trunk@242 -
peter 20 years ago
parent
commit
393101a64d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/htypechk.pas

+ 2 - 1
compiler/htypechk.pas

@@ -1153,7 +1153,8 @@ implementation
                    typedconstsym :
                    typedconstsym :
                      begin
                      begin
                        if ttypedconstsym(tloadnode(hp).symtableentry).is_writable or
                        if ttypedconstsym(tloadnode(hp).symtableentry).is_writable or
-                          (valid_addr in opts) then
+                          (valid_addr in opts) or
+                          (valid_const in opts) then
                         result:=true
                         result:=true
                        else
                        else
                         CGMessagePos(hp.fileinfo,type_e_no_assign_to_const);
                         CGMessagePos(hp.fileinfo,type_e_no_assign_to_const);