From 6fb958a49152c20608065c9d98839b6fc32b8bfb Mon Sep 17 00:00:00 2001 From: svenbarth Date: Wed, 9 Jan 2013 09:34:20 +0000 Subject: [PATCH] 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 - --- compiler/symdef.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 710c403045..ebb9b74752 100644 --- a/compiler/symdef.pas +++ b/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;