[fpc-pascal] Illegal expression when redeclare typed constant

Zamrony P. Juhara zamronypj at yahoo.com
Sun Mar 26 00:04:52 CET 2023


Suppose  I have
unit mytest;
interface
const    MY_VALUE = 1;    MY_INT_VALUE: integer = 1;
implementationend.
and second unit

unit mytest2;
interface
uses mytest;
const    // this is legal    MY_VALUE = mytest.MY_VALUE;
    // this  causes illegal expression    // MY_INT_VALUE = mytest.MY_INT_VALUE;    // MY_INT_VALUE : integer = mytest.MY_INT_VALUE;
implementationend.

Is there workaround to redeclare typed constant in other unit so that I don't need to duplicate code?
Thanks
Zamrony P. Juharahttps://juhara.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20230325/877d646f/attachment.htm>


More information about the fpc-pascal mailing list