I’m parsing Json with RTL2 and am trying to use a case statement to determine the value type.
I have a variable jsonItem
of type JsonNode
.
This works as expected:
if jsonItem is JsonIntegerValue then
...
else if jsonItem is JsonStringValue then
...
This does not compile:
case jsonItem of
JsonIntegerValue:
;
JsonStringValue:
;
else
end;
I get a compiler error
Type mismatch, expected “JsonNode”
From the docs it looks like this should work. Am I missing something?