onryldz / x-superobject

Delphi Cross Platform Rapid JSON
316 stars 118 forks source link

Problem with Internal Error #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I try to compile your last revision I got an internal error:
2066 line in the SetValue class method. Label is the problem!!

To solve it than work for me, can you change this mathod like this:

var
  RVal: REVAL;
begin
  if (TypeInfo(Typ) = TypeInfo(Integer)) and (GetMemberTypeInfo(Member, false).Kind in [tkArray,tkDynArray]) then
    case GetMemberTypeInfo(Member, false).Kind of
      tkArray:
        Val.ExtractRawData(Data);
      tkDynArray:
        GetValue<string>(GetArrayRawData(Member), Member, '').SetArrayElement(PInteger(@MIdx)^, Val)
    end
  else
  begin
    if Member is TRttiProperty then
    begin
      RVal := GetREVAL(TRttiProperty(Member).GetAttributes);
      if (RVal <> nil) and (RVal.CheckEQ(Val)) then
        Val := TValue.FromVariant(RVal.Value);
      TRttiProperty(Member).SetValue(Data, Val)
    end
    else
      if Member is TRttiField then
    begin
      RVal := GetREVAL(TRttiProperty(Member).GetAttributes);
      if (RVal <> nil) and (RVal.CheckEQ(Val)) then
        Val := TValue.FromVariant(RVal.Value);
      TRttiField(Member).SetValue(Data, Val);
    end;
  end;
end;

Original issue reported on code.google.com by isigest...@gmail.com on 11 Mar 2015 at 8:50

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r92.

Original comment by onryld...@gmail.com on 11 Mar 2015 at 12:15