<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 11, 2015 at 2:26 AM, silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Trying to set the value 'a' to a property Char and a 'True' to a Boolean property, I got some errors (logs in attached) in function 'TypInfo.SetPropValue'. But I did the same test in Delphi XE 7 and also in Delphi 7 (after some changes in my demo, shure), and it worked fine. So I decided to test other property types looking for more errors.</div><div><br></div><div>I attached a small project simulating a test-case, testing the function 'TypInfo.SetPropValue' with commum primitive types in FPC and Delphi.</div><div><div><br></div><div>Please see the LOG_*.TXT files, it has the comparition between FPC (trunk) and Delphi (XE7), both tests done in 32 and 64 CPUs.</div><div><br></div><div>Is this bug or a normal behaviour of FPC RTTI? If you confirm it as but, I can try to send a patch to fix that.</div><div><br></div><div>Thank you!</div></div></div></blockquote></div><div><br></div><div>Nobody? =/</div><div><br></div><div>It seems that current FPC SetPropValue looks like Delphi 7, but IMHO this function could follow the new Delphi implementation, including new unicode support. BTW, if anyone confirm it as bug, I can try to make a patch and send it via bugtracker.</div><div><br></div><div>I haven't tested function GetPropValue yet. And I haven't tested in Linux, but I believe that this problem occurs there too.</div><div><br></div><div>Just for check the difference between currently TypInfo of FPC and TypInfo of XE 7, bellow the two logs generated by my previous attached demo:</div><div><br></div><div>------- FPC -------</div><div>CPUX86<br></div><div><div><br></div><div>STRINGS:</div><div><br></div><div>MyString empty: OK</div><div>MyString: OK</div><div>MyAnsiString: OK</div><div>MyWideString: OK</div><div>MyUnicodeString: OK</div><div>MyShortString: OK</div><div><br></div><div>CHARS:</div><div><br></div><div>EVariantError: Invalid variant type cast</div><div>MyChar null: Fail</div><div>EVariantError: Invalid variant type cast</div><div>MyChar: Fail</div><div>EVariantError: Invalid variant type cast</div><div>MyAnsiChar: Fail</div><div>EVariantError: Invalid variant type cast</div><div>MyWideChar a: Fail</div><div>EVariantError: Invalid variant type cast</div><div>MyWideChar a: Fail</div><div>EVariantError: Invalid variant type cast</div><div>MyUnicodeChar a: Fail</div><div>EVariantError: Invalid variant type cast</div><div>MyUnicodeChar a: Fail</div><div><br></div><div>INTEGERS:</div><div><br></div><div>MyInteger zero: OK</div><div>MyByte <: OK</div><div>MyByte >: OK</div><div>MyShortInt <: OK</div><div>MyShortInt >: OK</div><div>MySmallInt <: OK</div><div>MySmallInt >: OK</div><div>MyWord <: OK</div><div>MyWord >: OK</div><div>MyInteger <: OK</div><div>MyInteger >: OK</div><div><br></div><div>INT64S:</div><div><br></div><div>MyInt64 zero: OK</div><div>MyCardinal <: OK</div><div>MyCardinal >: OK</div><div>MyLongInt <: OK</div><div>MyLongInt >: OK</div><div>MyLongWord <: OK</div><div>MyLongWord >: OK</div><div>MyInt64 <: OK</div><div>MyInt64 >: OK</div><div>MyQWord <: OK</div><div>MyQWord >: OK</div><div><br></div><div>BOOLEANS:</div><div><br></div><div>MyBoolean f: OK</div><div>MyBoolean t: OK</div><div>ERangeError: Range error</div><div>MyByteBool f: Fail</div><div>ERangeError: Range error</div><div>MyByteBool t: Fail</div><div>ERangeError: Range error</div><div>MyWordBool f: Fail</div><div>ERangeError: Range error</div><div>MyWordBool t: Fail</div><div>ERangeError: Range error</div><div>MyLongBool f: Fail</div><div>ERangeError: Range error</div><div>MyLongBool t: Fail</div><div><br></div><div>FLOATS:</div><div><br></div><div>MyFloat zero: OK</div><div>MySingle <: OK</div><div>MySingle >: OK</div><div>MyExtended <: OK</div><div>MyExtended >: OK</div><div>MyCurrency <: OK</div><div>MyCurrency >: OK</div><div>MyFloat <: OK</div><div>MyFloat >: OK</div><div>MyComp <: OK</div><div>MyComp >: OK</div><div><br></div><div>ENUMS:</div><div><br></div><div>MyEnum <: OK</div><div>MyEnum >: OK</div><div><br></div><div>SETS:</div><div><br></div><div>MySet <: OK</div><div>MySet >: OK</div><div>MySet <: OK</div><div>MySet >: OK</div><div>MySet <: OK</div><div>MySet >: OK</div><div>MySet <: OK</div><div>MySet >: OK</div></div><div>------- FPC -------<br></div><div><br></div><div>------- XE 7 -------</div><div><div>CPUX86</div><div><br></div><div>STRINGS:</div><div><br></div><div>MyString empty: OK</div><div>MyString: OK</div><div>MyAnsiString: OK</div><div>MyWideString: OK</div><div>MyUnicodeString: OK</div><div>MyShortString: OK</div><div><br></div><div>CHARS:</div><div><br></div><div>MyChar null: OK</div><div>MyChar: OK</div><div>MyAnsiChar: OK</div><div>MyWideChar a: OK</div><div>MyWideChar a: OK</div><div>MyUnicodeChar a: OK</div><div>MyUnicodeChar a: OK</div><div><br></div><div>INTEGERS:</div><div><br></div><div>MyInteger zero: OK</div><div>MyByte <: OK</div><div>MyByte >: OK</div><div>MyShortInt <: OK</div><div>MyShortInt >: OK</div><div>MySmallInt <: OK</div><div>MySmallInt >: OK</div><div>MyWord <: OK</div><div>MyWord >: OK</div><div>MyInteger <: OK</div><div>MyInteger >: OK</div><div><br></div><div>INT64S:</div><div><br></div><div>MyInt64 zero: OK</div><div>MyCardinal <: OK</div><div>MyCardinal >: OK</div><div>MyLongInt <: OK</div><div>MyLongInt >: OK</div><div>MyLongWord <: OK</div><div>MyLongWord >: OK</div><div>MyInt64 <: OK</div><div>MyInt64 >: OK</div><div><br></div><div>BOOLEANS:</div><div><br></div><div>MyBoolean f: OK</div><div>MyBoolean t: OK</div><div>MyByteBool f: OK</div><div>MyByteBool t: OK</div><div>MyWordBool f: OK</div><div>MyWordBool t: OK</div><div>MyLongBool f: OK</div><div>MyLongBool t: OK</div><div><br></div><div>FLOATS:</div><div><br></div><div>MyFloat zero: OK</div><div>MySingle <: OK</div><div>MySingle >: OK</div><div>MyExtended <: OK</div><div>MyExtended >: OK</div><div>MyCurrency <: OK</div><div>MyCurrency >: OK</div><div>MyFloat <: OK</div><div>MyFloat >: OK</div><div>MyComp <: OK</div><div>MyComp >: OK</div><div><br></div><div>ENUMS:</div><div><br></div><div>MyEnum <: OK</div><div>MyEnum >: OK</div><div><br></div><div>SETS:</div><div><br></div><div>MySet <: OK</div><div>MySet >: OK</div><div>MySet <: OK</div><div>MySet >: OK</div><div>MySet <: OK</div><div>MySet >: OK</div><div>MySet <: OK</div><div>MySet >: OK</div></div><div>------- XE 7 -------<br></div><div><br></div>-- <br><div>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a></div>
</div></div>