Browse Source

* correctly set the generic related defoptions for an outlined procdef

git-svn-id: trunk@45645 -
svenbarth 5 years ago
parent
commit
4da6465d05
1 changed files with 4 additions and 0 deletions
  1. 4 0
      compiler/procdefutil.pas

+ 4 - 0
compiler/procdefutil.pas

@@ -65,6 +65,10 @@ implementation
       symtablestack:=nil;
       symtablestack:=nil;
       result:=cprocdef.create(max(normal_function_level,st.symtablelevel)+1,true);
       result:=cprocdef.create(max(normal_function_level,st.symtablelevel)+1,true);
       result.returndef:=resultdef;
       result.returndef:=resultdef;
+      { if the parent is a generic or a specialization, the new function is one
+        as well }
+      if st.symtabletype=localsymtable then
+        result.defoptions:=result.defoptions+(tstoreddef(st.defowner).defoptions*[df_generic,df_specialization]);
       symtablestack:=oldsymtablestack;
       symtablestack:=oldsymtablestack;
       st.insertdef(result);
       st.insertdef(result);
       result.struct:=astruct;
       result.struct:=astruct;