summaryrefslogtreecommitdiff
path: root/compiler/symconst.pas
diff options
context:
space:
mode:
authorsvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-05-29 08:19:02 +0000
committersvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-05-29 08:19:02 +0000
commit16a3fb0f494e75e54361a9c0984ed39055b5287f (patch)
tree6a0710f0726be7c237c7b9a151ee05c395b7226f /compiler/symconst.pas
parent21ad009a5a8d86ebdae5e3bbeb80803b18fdf50b (diff)
downloadfpc-16a3fb0f494e75e54361a9c0984ed39055b5287f.tar.gz
Completely reworked implementation of generic constraints, by moving the generic constraint data from the symbols to the definitions (I originally thought that this would simplyfy things, but the more correct approach is to add it to the defs).
symsym.pas: - remove "tgenericconstraintdata" and any using/loading/writing of it in "ttypesym" - remove "tgenericconstraintflag" symdef.pas: + add "tgenericconstraintdata" + load and write "genconstraintdata" in "tstoreddef" symconst.pas: + add "tgenericconstraintflag" so it can be used in "ppudump" as well defcmp.pas, compare_defs_ext: * as we allow global operator overloads we can't really determine whether two defs are compatible, because a valid operator for the specialization types might just happen to be in scope of the generic; so for now constraints are only strictly checked when declaring a specialization pgenutil.pas: * adjust "parse_generic_parameters" and "check_generic_constraints" to the new location of the constraint data ppudump.pp: * corrrectly parse defs which contain generic constraints git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24628 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/symconst.pas')
-rw-r--r--compiler/symconst.pas8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/symconst.pas b/compiler/symconst.pas
index ae98ad00ab..83dd7982b2 100644
--- a/compiler/symconst.pas
+++ b/compiler/symconst.pas
@@ -206,6 +206,14 @@ type
);
tdefstates=set of tdefstate;
+ { flags for generic type constraints }
+ tgenericconstraintflag=(gcf_none,
+ gcf_constructor, { specialization type needs to have a constructor }
+ gcf_class, { specialization type needs to be a class }
+ gcf_record { specialization type needs to be a record type }
+ );
+ tgenericconstraintflags=set of tgenericconstraintflag;
+
{ tsymlist entry types }
tsltype = (sl_none,
sl_load,