Wrong implicit cast from "integer" to "JSONvariant".

Issue #181 resolved
Sergio Rossi created an issue

Hi.
Please consider the following code:

var Output:=JSON.NewObject;

procedure Test(Value:JSONvariant);
begin
  Output.Type:=Value.TypeName(); // TypeName returns "Undefined" but it's wrong.
end;

var Value:=10;
Test(Value);

As highlighted in the code comment above, when you call the Test procedure with a variable containing an integer value, the TypeName function returns the string "Undefined" but it's obviously wrong.

If you use it instead:

var Value:=10.0; // Value 10 writtes as float
Test(Value);

the function TypeName would correctly return the string "Number".

Comments (1)

  1. Log in to comment