Browse Source

symdef.pas, tstoreddef:
* adjust "is_generic" so that it will really work for true generics only
+ added an analogous method "is_specialization" for specializations

Both methods are not used yet, but this will change in the future...

git-svn-id: trunk@23348 -

svenbarth 12 years ago
parent
commit
6fb958a491
1 changed files with 10 additions and 1 deletions
  1. 10 1
      compiler/symdef.pas

+ 10 - 1
compiler/symdef.pas

@@ -95,6 +95,8 @@ interface
             generic declaration or just a normal type declared inside another
             generic }
           function is_generic:boolean;inline;
+          { same as above for specializations }
+          function is_specialization:boolean;inline;
        private
           savesize  : asizeuint;
        end;
@@ -1638,9 +1640,16 @@ implementation
        generictokenbuf:=tdynamicarray.create(256);
      end;
 
+
    function tstoreddef.is_generic: boolean;
      begin
-       result:=genericparas.count>0;
+       result:=(genericparas.count>0) and (df_generic in defoptions);
+     end;
+
+
+   function tstoreddef.is_specialization: boolean;
+     begin
+       result:=(genericparas.count>0) and (df_specialization in defoptions);
      end;