Michael Van Canneyt <mich...@freepascal.org> schrieb am Do., 7. Nov. 2019, 16:23:
> > > On Thu, 7 Nov 2019, Ben Grasset via fpc-pascal wrote: > > > On Thu, Nov 7, 2019 at 3:03 AM Sven Barth via fpc-pascal < > > fpc-pascal@lists.freepascal.org> wrote: > > > >> If there is no type checking, then it is *not* verified by the compiler. > >> > > > > Perhaps "no type checking" was not the write way to put it. A better way > to > > describe it might be: > > > > [snip] > > > E.G. it could still do the full checking, as the only thing that really > > matters is that it does not actively raise error messages only relevant > for > > Integer under code blocks only entered for tkFloat. > > If I understood Sven's example correct, then the compiler does exactly this > already. > 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. Regards, Sven >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal