Type check for compile time expressions added

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Type check for compile time expressions added

Olle Raab
Type checking of compile time expression has been added to Free Pascal

Compile time expression are used in $IF/$IFC, and under mode MacPas, in

This should hopefully help everyone to find some errors, but if it makes
trouble for anyone please let me know.


Implementation details:

Each subexpression returns its type to the caller, which then can
do type check.  Since data types of compile time expressions is
not well defined, the type system does a best effort. The drawback is
that some errors might not be detected.

Instead of returning a particular data type, a set of possible data types
are returned. This way ambigouos types can be handled.  For instance a
value of 1 can be both a boolean and and integer.

Svn revision 919

Olle Raab

fpc-pascal maillist  -  [hidden email]