Skip to content

[Rtti] TValue doesn't handle tkAString in convertion methods

TValue.CastFromType and TValue.CastFromString doesn't handle tkAString, so simple test is failed

program Project1;

{$mode objfpc}
{$H+}

uses
  Rtti;
var
  S: string;
  V, V2: TValue;
begin
  S := 'str';
  V := S;
  if not V.TryCast(TypeInfo(UnicodeString), V2) then
  begin
    WriteLn('TryCast is failed');
    Halt(1);
  end;
end. 

1.patch

Edited by Евгений Савин
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information