[fpc-devel] Dangerous optimization in CASE..OF

Sven Barth pascaldragon at googlemail.com
Fri Apr 13 23:16:08 CEST 2018


Ondrej Pokorny <lazarus at kluug.net> schrieb am Fr., 13. Apr. 2018, 21:16:

> On 13.04.2018 14:08, Sven Barth via fpc-devel wrote:
>
> Ondrej Pokorny <lazarus at kluug.net> schrieb am Fr., 13. Apr. 2018, 12:52:
>
>> I introduced the AS operator for enumerations in
>> https://bugs.freepascal.org/view.php?id=33603
>>
>
> What about enums with holes?
>
>
> No problem because Low() and High() work with these enums as well. See the
> test case project I attached to the bug report - it has a test with such an
> enum.
>

I wasn't talking about the boundaries. I meant undefined values inside the
enum. If we want such a cast operator to work with such enums as well it
should check for invalid values inside the enum, too. Otherwise the
operator isn't worth it and should be forbidden for such enums.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180413/e2928aaf/attachment.html>


More information about the fpc-devel mailing list