<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> schrieb am Do., 7. Nov. 2019, 16:23:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Thu, 7 Nov 2019, Ben Grasset via fpc-pascal wrote:<br>
<br>
> On Thu, Nov 7, 2019 at 3:03 AM Sven Barth via fpc-pascal <<br>
> <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
><br>
>> If there is no type checking, then it is *not* verified by the compiler.<br>
>><br>
><br>
> Perhaps "no type checking" was not the write way to put it. A better way to<br>
> describe it might be:<br>
><br>
<br>
[snip]<br>
<br>
> E.G. it could still do the full checking, as the only thing that really<br>
> matters is that it does not actively raise error messages only relevant for<br>
> Integer under code blocks only entered for tkFloat.<br>
<br>
If I understood Sven's example correct, then the compiler does exactly this<br>
already.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Not quite. If the generic parameter T is a LongInt, then the branch for tkFloat *must* also be valid for LongInts. Because the type checking is done *before* the branch is discarded. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>