def implicit_cast(t1, t2):
    """
    Checks whether two types can be implicitly casted
    to one of each other.
    Returns `None` if no implicit cast can be performed.
    """
    t1_t2 = t1.implicit_to(t2)
    if t1_t2 is not None:
        return t1_t2
    t2_t1 = t2.implicit_to(t1)
    if t2_t1 is not None:
        return t2_t1
    return None
