code: void expectCanCast(Node n, JSType targetType, JSType sourceType) {
      if (!sourceType.canCastTo(targetType)) {
        registerMismatch(
            sourceType,
            targetType,
            report(JSError.make(n, INVALID_CAST, sourceType.toString(), targetType.toString())));
      } else if (!sourceType.isSubtypeWithoutStructuralTyping(targetType)){
        TypeMismatch.recordImplicitInterfaceUses(
            this.implicitInterfaceUses, n, sourceType, targetType);
      }
    }
docs: Expect that the first type can be cast to the second type. The first type must have some
  relationship with the second.
  
  @param t The node traversal.
  @param n The node where warnings should point.
  @param targetType The type being cast to.
  @param sourceType The type being cast from.