Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-08

Type check for compile time expressions added

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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 $SETC

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

Reply by email