Re: [fpc-pascal] Generic (TFPGObjectList) EInvalidCast

2018-12-11 Thread Vojtěch Čihák
Yes, I see now, it was my mistake.   Thanks. __ Od: "Mattias Gaertner via fpc-pascal" Komu: fpc-pascal@lists.freepascal.org Datum: 11.12.2018 22:35 Předmět: Re: [fpc-pascal] Generic (TFPGObjectList) EInvalidCast On Tue, 1

Re: [fpc-pascal] Generic (TFPGObjectList) EInvalidCast

2018-12-11 Thread Mattias Gaertner via fpc-pascal
On Tue, 11 Dec 2018 22:19:11 +0100 Vojtěch Čihák wrote: > Hi, >   > why this code gives EInvalidCast at runtime (but compiles well):w >   > program Project1; > {$mode objfpc}{$H+} >   > uses >   {$IFDEF UNIX}{$IFDEF UseCThreads} >   cthreads, >   {$ENDIF}{$ENDIF} >   Classes, fgl >   { you can ad

Re: [fpc-pascal] Generic (TFPGObjectList) EInvalidCast

2018-12-11 Thread Vojtěch Čihák
Sorry for noise, this was wrong code and even more it has nothing to do with generics. I can solve it with class helper.   V.   __ Od: "Vojtěch Čihák" Komu: "FPC-Pascal users discussions" Datum: 11.12.2018 22:19 Předmět: [fpc-pascal]

Re: [fpc-pascal] Generic (TFPGObjectList) EInvalidCast

2018-12-11 Thread Vojtěch Čihák
I forgot: FreePascal 3.3.1 r.40507   V. __ Od: "Vojtěch Čihák" Komu: "FPC-Pascal users discussions" Datum: 11.12.2018 22:19 Předmět: [fpc-pascal] Generic (TFPGObjectList) EInvalidCast Hi,   why this code gives EInvalidCast at runtime