With user-defined types, different rules are applied for assignments to host variables than are used for all other assignments.
Distinct Types: Assignment to host variables is done based on the source type of the distinct type. That is, it follows the rule:
If the target of the assignment is a column based on a distinct type, the source data type must be castable to the target data type as described in Casting Between Data Types for user-defined types.
Structured Types: Assignment to and from host variables is based on the declared type of the host variable. That is, it follows the rule:
A value of a structured type on the right hand side of an assignment is assignable to a host variable on the left hand side if and only if the declared type of the host variable is the structured type or a supertype of the structured type.
If the target of the assignment is a column of a structured type, the source data type must be the target data type or a subtype of the target data type.