Skip to content

Commit

Permalink
Changed functions TJSONValue.AsType<T> and TValue.Make<T> to bring ba…
Browse files Browse the repository at this point in the history
…ck compatibility for Delphi 10.4 and earlier. Fixes #47 #48
  • Loading branch information
paolo-rossi committed Jul 6, 2022
1 parent 4e145bd commit 0b9c1f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Neon.Core.Persistence.JSON.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ function TNeonDeserializerJSON.ReadFloat(const AParam: TNeonDeserializerParam):
end;

try
LFloat := (AParam.JSONValue as TJSONNumber).AsType<Extended>;
LFloat := (AParam.JSONValue as TJSONNumber).GetValue<Extended>;
except
on E: EOverflow do
raise ENeonException.CreateFmt('The value [%s] is outside the range for the type [%s]', [AParam.JSONValue.Value, LMsg]);
Expand Down Expand Up @@ -1546,7 +1546,7 @@ function TNeonDeserializerJSON.ReadInt64(const AParam: TNeonDeserializerParam):
else
begin
LUInt := StrToUInt64(AParam.JSONValue.Value);
TValue.Make<UInt64>(LUInt, Result);
TValue.Make(@LUInt, System.TypeInfo(UInt64), Result);
end;
end;

Expand Down

0 comments on commit 0b9c1f7

Please sign in to comment.