Browse Source

* keep track of the fileposinfo for generic constraints

git-svn-id: trunk@44188 -
svenbarth 5 years ago
parent
commit
41a6957f7d
2 changed files with 6 additions and 0 deletions
  1. 4 0
      compiler/pgenutil.pas
  2. 2 0
      compiler/symdef.pas

+ 4 - 0
compiler/pgenutil.pas

@@ -1168,6 +1168,7 @@ uses
         doconsume : boolean;
         constraintdata : tgenericconstraintdata;
         old_block_type : tblock_type;
+        fileinfo : tfileposinfo;
       begin
         result:=tfphashobjectlist.create(false);
         firstidx:=0;
@@ -1183,12 +1184,14 @@ uses
               result.add(orgpattern,generictype);
             end;
           consume(_ID);
+          fileinfo:=current_tokenpos;
           if try_to_consume(_COLON) then
             begin
               if not allowconstraints then
                 Message(parser_e_generic_constraints_not_allowed_here);
               { construct a name which can be used for a type specification }
               constraintdata:=tgenericconstraintdata.create;
+              constraintdata.fileinfo:=fileinfo;
               defname:='';
               str(current_module.deflist.count,defname);
               defname:='$gendef'+defname;
@@ -1305,6 +1308,7 @@ uses
                     genconstraintdata:=tgenericconstraintdata.create;
                     genconstraintdata.flags:=constraintdata.flags;
                     genconstraintdata.interfaces.assign(constraintdata.interfaces);
+                    genconstraintdata.fileinfo:=constraintdata.fileinfo;
                     include(defoptions,df_genconstraint);
                   end;
 

+ 2 - 0
compiler/symdef.pas

@@ -50,6 +50,8 @@ interface
          interfaces : tfpobjectlist;
          interfacesderef : tfplist;
          flags : tgenericconstraintflags;
+         { only required while parsing }
+         fileinfo : tfileposinfo;
          constructor create;
          destructor destroy;override;
          procedure ppuload(ppufile:tcompilerppufile);