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 type is suppose to return>.

The following code (#1) causes the runtime error (#2) (Object or collection expected)>.

<code 4D>
Value type(
</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>
</code 4D>

This expression is undefined. (#4
<code 4D>
</code 4D>

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

So why does a runtime error occur?

Why is 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.