<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Ondrej Pokorny <<a href="mailto:lazarus@kluug.net">lazarus@kluug.net</a>> schrieb am Fr., 13. Apr. 2018, 21:16:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_-2479975938792404394moz-cite-prefix">On 13.04.2018 14:08, Sven Barth via
fpc-devel wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr">Ondrej Pokorny <<a href="mailto:lazarus@kluug.net" target="_blank" rel="noreferrer">lazarus@kluug.net</a>>
schrieb am Fr., 13. Apr. 2018, 12:52:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">I introduced the AS
operator for enumerations in <a class="m_-2479975938792404394m_7860075233186958794moz-txt-link-freetext" href="https://bugs.freepascal.org/view.php?id=33603" rel="noreferrer noreferrer" target="_blank">https://bugs.freepascal.org/view.php?id=33603</a></div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">What about enums with holes?</div>
</div>
</blockquote>
<br>
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.<br></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div></div>