Browse Source

* Allow Boolean -> TValue

Michaël Van Canneyt 8 months ago
parent
commit
eb08fd88f2
1 changed files with 7 additions and 1 deletions
  1. 7 1
      packages/vcl-compat/src/system.json.pp

+ 7 - 1
packages/vcl-compat/src/system.json.pp

@@ -1619,7 +1619,13 @@ end;
 
 function TJSONBool.AsTValue(aTypeInfo: PTypeInfo; var aValue: TValue): Boolean;
 begin
-  Result:=inherited AsTValue(aTypeInfo, aValue);
+  if aTypeInfo^.Kind=tkBool then
+    begin
+    TValue.Make(@FValue,aTypeInfo,aValue);
+    Result:=True;
+    end
+  else
+    Result:=inherited AsTValue(aTypeInfo, aValue);
 end;
 
 constructor TJSONBool.Create(aValue: Boolean);