I think it will be better if union type is only allowed in the "type"
statement, like what you described in your RFC.

type Iterable = Array <http://www.php.net/array> | Traversable;

If we can always pre-define the types.

And only allow just one type for each function parameter in the function
prototype, then, I think the performance impact of type checking in the
runtime might be able to be reduced.

In other words, you predefine the union type before you used them, and the
union types can be reused in different functions, you don't write a lot
union type in function prototype.

Reply via email to