mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 10:29:29 +02:00
The sources of the Free Pascal compiler, RTL, packages and utilities.
See https://www.freepascal.org/ for more info.
![]() symtable.pas: * reduce the "childdef" parameter of "is_owned_by" from "tabstractrecorddef" to "tdef", so that more primitive defs can be checked as well * add a new function "sym_is_owned_by" which is similar to "is_owned_by", but takes a symbol and a symtable as parameter; the owner chain of the symtable is checked until a non-object- and non-record-symtable is reached ptype.pas: * extend "id_type", so that the symbol and the symtable that belongs to the returned def is returned as well * this is needed to check inside "single_type" whether a def that is a generic was specialized inside another generic, because in that case the genericdef is returned by "generate_specialization" and not a new specialized def, but the corresponding type symbol (which is different from "hdef.typesym") belongs to the class itself; I need to admit that this solution isn't very clean and one could try to circumvent some of the checks, so I need to find a better detection for such a case (concrete example: the enumerator specialization inside the classes of "fgl.pas") * in "read_named_type.expr_type" the check for "df_generic" is extended analogous to the previous change, but instead of relying on the symbol it uses the def. This is needed so that types like method pointers that are defined inside the current generic are not disallowed as they contain the "df_generic" flag as well; like the previous change this change isn't clean either and maybe it's better to remove the inclusion of the "df_generic" flag from everything except records and "objects" inside records/"objects" again. Such a solution will "only" reduce the problem to records and "objects" though... pgenutil.pas: * only add a new undefined def if we're not parsing the parent class or interfaces ("parse_class_parent" is true), otherwise the InternalError regarding the "equal count of defs" will trigger * there are now two cases where we need to return a generic def instead of a undefined one when we're parsing a generic: a) we have the previously mentioned case that "parse_class_parent" is true b) an undefined def was added, but we need to return a generic def, so that checks can be passed * use the correct variable when building the generic name, otherwise we get errors like "identifier '$1' not found" * don't push the symtable if we're currently parsing the list of interfaces or the parent class, because then e.g. a generic interface will be included in the symtable of the implementing class which isn't what we want; the current solution is not clean though, so this needs to be investigated more * Note: In the current state of "generate_specialization" the function could be simplyfied a bit more; this will be done when the implementation is satisfactory enough git-svn-id: branches/svenbarth/generics@19430 - |
||
---|---|---|
compiler | ||
ide | ||
installer | ||
packages | ||
rtl | ||
tests | ||
utils | ||
.gitattributes | ||
.gitignore | ||
Makefile | ||
Makefile.fpc |