[Suggestion] Explicit vs Implicit typecasting
Posted: 16.10.2017, 14:02
Hi,
I use the 7.1.x release of Zeoslib and I've saw that there's some difficulties to compile the source with CodeTyphon (Typhon - V6.x) based on FPC 3.x. and Lazarus. Because some instructions contains implicit typecasting.
The best way is to make explicit typecasting with the key word as like :
HashMap.FKeys := (FKeys.Clone as IZCollection);
HashMap.FReadOnlyKeys := (FReadOnlyKeys.Clone as IZCollection);
HashMap.FValues := (FValues.Clone as IZCollection);
HashMap.FReadOnlyValues := (FReadOnlyValues.Clone as IZCollection);
than :
HashMap.FKeys := IZCollection(FKeys.Clone);
HashMap.FReadOnlyKeys := IZCollection(FReadOnlyKeys.Clone);
HashMap.FValues := IZCollection(FValues.Clone);
HashMap.FReadOnlyValues := IZCollection(FReadOnlyValues.Clone);
In ZCollections.pas.
Thank's.
Frédéric Libaud
I use the 7.1.x release of Zeoslib and I've saw that there's some difficulties to compile the source with CodeTyphon (Typhon - V6.x) based on FPC 3.x. and Lazarus. Because some instructions contains implicit typecasting.
The best way is to make explicit typecasting with the key word as like :
HashMap.FKeys := (FKeys.Clone as IZCollection);
HashMap.FReadOnlyKeys := (FReadOnlyKeys.Clone as IZCollection);
HashMap.FValues := (FValues.Clone as IZCollection);
HashMap.FReadOnlyValues := (FReadOnlyValues.Clone as IZCollection);
than :
HashMap.FKeys := IZCollection(FKeys.Clone);
HashMap.FReadOnlyKeys := IZCollection(FReadOnlyKeys.Clone);
HashMap.FValues := IZCollection(FValues.Clone);
HashMap.FReadOnlyValues := IZCollection(FReadOnlyValues.Clone);
In ZCollections.pas.
Thank's.
Frédéric Libaud