[fpc-devel] Illegal type conversion: "<enumeration type>" to"TObject"

Vinzent Höfler JeLlyFish.software at gmx.net
Fri Jul 18 00:30:35 CEST 2008


Boian Mitov wrote:
> Now only if we can go ~15 years back in time and tell that to the 
> original developers of VCL and things like TStrings and their data type 
> ;-) . Unfortunately they take TObject only, and there are a lot of cases 
> when casting other data types to it is needed. I wish it was not the 
> case, but it is the reality :-( .

Hmm, point taken. Well, at least TStrings doesn't seem to add any 
functionality to further handle such "objects", especially it doesn't 
try "Free"ing any of them.

> ----- Original Message ----- From: "Vinzent Höfler" 
> <JeLlyFish.software at gmx.net>
> To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
> Sent: Thursday, July 17, 2008 3:12 PM
> Subject: Re: [fpc-devel] Illegal type conversion: "<enumeration type>" 
> to"TObject"
> 
> 
>> Apart from that I don't see any sense in such type of a typecast.
>>
>> If I were to store such things in a "generic" list data type I would 
>> use a pointer list, not an object list, if alone to avoid the risk of 
>> accidentally trying to "Free" such objects.

Vinzent.



More information about the fpc-devel mailing list