def _deep_update_type_hint(node: Node, type_hint: Any) -> None:
    'Ensure node is compatible with type_hint, mutating if necessary.'
    from omegaconf import DictConfig, ListConfig
    from ._utils import get_dict_key_value_types, get_list_element_type
    if (type_hint is Any):
        return
    _shallow_validate_type_hint(node, type_hint)
    (new_is_optional, new_ref_type) = _resolve_optional(type_hint)
    node._metadata.ref_type = new_ref_type
    node._metadata.optional = new_is_optional
    if (is_list_annotation(new_ref_type) and isinstance(node, ListConfig)):
        new_element_type = get_list_element_type(new_ref_type)
        node._metadata.element_type = new_element_type
        if (not _is_special(node)):
            for i in range(len(node)):
                _deep_update_subnode(node, i, new_element_type)
    if (is_dict_annotation(new_ref_type) and isinstance(node, DictConfig)):
        (new_key_type, new_element_type) = get_dict_key_value_types(new_ref_type)
        node._metadata.key_type = new_key_type
        node._metadata.element_type = new_element_type
        if (not _is_special(node)):
            for key in node:
                if ((new_key_type is not Any) and (not isinstance(key, new_key_type))):
                    raise KeyValidationError((f'Key {key!r} ({type(key).__name__}) is incompatible' + f" with key type hint '{new_key_type.__name__}'"))
                _deep_update_subnode(node, key, new_element_type)
Ensure node is compatible with type_hint, mutating if necessary.
def _deep_update_type_hint(node: Node, type_hint: Any) -> None:
    
    from omegaconf import DictConfig, ListConfig
    from ._utils import get_dict_key_value_types, get_list_element_type
    if (type_hint is Any):
        return
    _shallow_validate_type_hint(node, type_hint)
    (new_is_optional, new_ref_type) = _resolve_optional(type_hint)
    node._metadata.ref_type = new_ref_type
    node._metadata.optional = new_is_optional
    if (is_list_annotation(new_ref_type) and isinstance(node, ListConfig)):
        new_element_type = get_list_element_type(new_ref_type)
        node._metadata.element_type = new_element_type
        if (not _is_special(node)):
            for i in range(len(node)):
                _deep_update_subnode(node, i, new_element_type)
    if (is_dict_annotation(new_ref_type) and isinstance(node, DictConfig)):
        (new_key_type, new_element_type) = get_dict_key_value_types(new_ref_type)
        node._metadata.key_type = new_key_type
        node._metadata.element_type = new_element_type
        if (not _is_special(node)):
            for key in node:
                if ((new_key_type is not Any) and (not isinstance(key, new_key_type))):
                    raise KeyValidationError((f'Key {key!r} ({type(key).__name__}) is incompatible' + f" with key type hint '{new_key_type.__name__}'"))
                _deep_update_subnode(node, key, new_element_type)