Browse Source

* properties can be also passed to formal const parameters

git-svn-id: trunk@5419 -
florian 18 years ago
parent
commit
81726e85d7
3 changed files with 22 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/htypechk.pas
  3. 20 0
      tests/tbs/tb0510.pp

+ 1 - 0
.gitattributes

@@ -6157,6 +6157,7 @@ tests/tbs/tb0506.pp svneol=native#text/plain
 tests/tbs/tb0507.pp svneol=native#text/plain
 tests/tbs/tb0507.pp svneol=native#text/plain
 tests/tbs/tb0508.pp svneol=native#text/plain
 tests/tbs/tb0508.pp svneol=native#text/plain
 tests/tbs/tb0509.pp svneol=native#text/plain
 tests/tbs/tb0509.pp svneol=native#text/plain
+tests/tbs/tb0510.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain

+ 1 - 1
compiler/htypechk.pas

@@ -1353,7 +1353,7 @@ implementation
     function  valid_for_formal_const(p : tnode; report_errors: boolean) : boolean;
     function  valid_for_formal_const(p : tnode; report_errors: boolean) : boolean;
       begin
       begin
         valid_for_formal_const:=(p.resultdef.typ=formaldef) or
         valid_for_formal_const:=(p.resultdef.typ=formaldef) or
-          valid_for_assign(p,[valid_void,valid_const],report_errors);
+          valid_for_assign(p,[valid_void,valid_const,valid_property],report_errors);
       end;
       end;
 
 
 
 

+ 20 - 0
tests/tbs/tb0510.pp

@@ -0,0 +1,20 @@
+{$mode objfpc}
+type
+  TSynIdentChars = set of char;
+  tobj = class
+    function GetIdentChars: TSynIdentChars; virtual;
+    procedure p(s : tSynIdentChars);
+    property IdentChars: TSynIdentChars read GetIdentChars;
+  end;
+
+function tobj.GetIdentChars: TSynIdentChars;
+  begin
+  end;
+
+procedure tobj.p(s : tSynIdentChars);
+   begin
+     p(IdentChars+['-']);
+   end;
+
+begin
+end.