Value type command (Why does undefined expression cause runtime error?)

Why does the command Value type cause a runtime error when evaluating an undefined expression?

What’s odd is that Is undefined is one of the results the command https://doc.4d.com/4Dv17R5/4D/17-R5/Value-type.301-4127652.en.htmlValue type is suppose to return>.

The following code (#1) causes the runtime error (#2) https://doc.4d.com/4Dv17R5/4D/17-R5/Object-Notation-Analysis-Errors-10737-10701.300-4127423.en.html-10716 (Object or collection expected)>.

<code 4D>
Value type(Form.LBB.item.object_converted_incomplete_log.data)
</code 4D>

Here is a snapshot of the debugger showing the expression’s values.

Note these expression values:

This expression is null. (#3)
<code 4D>
Form.LBB.item.object_converted_incomplete_log
</code 4D>

This expression is undefined. (#4
<code 4D>
Form.LBB.item.object_converted_incomplete_log.data
</code 4D>

Both Is null and Is undefined are returned by Value type.

So why does a runtime error occur?

Why is https://doc.4d.com/4Dv17R5/4D/17-R5/Value-type.301-4127652.en.htmlValue type> failing to return a value?

it’s probably a case of Form confusing the code parser.

using parentheses or assigning Form to a local object variable should do the trick. I think.