/*
     * (a: SubjectType) is Type
     */
private static void checkTypeCompatibility(
            @NotNull ExpressionTypingContext context,
            @Nullable JetType type,
            @NotNull JetType subjectType,
            @NotNull JetElement reportErrorOn
    ) {
        // TODO : Take smart casts into account?
        if (type == null) {
            return;
        }
        if (isIntersectionEmpty(type, subjectType)) {
            context.trace.report(INCOMPATIBLE_TYPES.on(reportErrorOn, type, subjectType));
            return;
        }
        // check if the pattern is essentially a 'null' expression
        if (KotlinBuiltIns.isNullableNothing(type) && !TypeUtils.isNullableType(subjectType)) {
            context.trace.report(SENSELESS_NULL_IN_WHEN.on(reportErrorOn));
        }
    }
private static void checkTypeCompatibility(
@NotNull ExpressionTypingContext context,
@Nullable JetType type,
@NotNull JetType subjectType,
@NotNull JetElement reportErrorOn
) {
// TODO : Take smart casts into account?
if (type == null) {
return;
}
if (isIntersectionEmpty(type, subjectType)) {
context.trace.report(INCOMPATIBLE_TYPES.on(reportErrorOn, type, subjectType));
return;
}
// check if the pattern is essentially a 'null' expression
if (KotlinBuiltIns.isNullableNothing(type) && !TypeUtils.isNullableType(subjectType)) {
context.trace.report(SENSELESS_NULL_IN_WHEN.on(reportErrorOn));
}
}
private static void checkTypeCompatibility(
@NotNull ExpressionTypingContext context,
@Nullable JetType type,
@NotNull JetType subjectType,
@NotNull JetElement reportErrorOn
) {
// TODO : Take smart casts into account?
if (type == null) {
return;
}
if (isIntersectionEmpty(type, subjectType)) {
context.trace.report(INCOMPATIBLE_TYPES.on(reportErrorOn, type, subjectType));
return;
}
// check if the pattern is essentially a 'null' expression
if (KotlinBuiltIns.isNullableNothing(type) && !TypeUtils.isNullableType(subjectType)) {
context.trace.report(SENSELESS_NULL_IN_WHEN.on(reportErrorOn));
}
}
private static void checkTypeCompatibility(
@NotNull ExpressionTypingContext context,
@Nullable JetType type,
@NotNull JetType subjectType,
@NotNull JetElement reportErrorOn
) {
// TODO : Take smart casts into account?
if (type == null) {
return;
}
if (isIntersectionEmpty(type, subjectType)) {
context.trace.report(INCOMPATIBLE_TYPES.on(reportErrorOn, type, subjectType));
return;
}
// check if the pattern is essentially a 'null' expression
if (KotlinBuiltIns.isNullableNothing(type) && !TypeUtils.isNullableType(subjectType)) {
context.trace.report(SENSELESS_NULL_IN_WHEN.on(reportErrorOn));
}
}