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
    ) {
       
        if (type == null) {
            return;
        }
        if (isIntersectionEmpty(type, subjectType)) {
            context.trace.report(INCOMPATIBLE_TYPES.on(reportErrorOn, type, subjectType));
            return;
        }
       
        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 ) { if (type == null) { return; } if (isintersectionempty(type, subjecttype)) { context.trace.report(incompatible_types.on(reporterroron, type, subjecttype)); return; } if (kotlinbuiltins.isnullablenothing(type) && !typeutils.isnullabletype(subjecttype)) { context.trace.report(senseless_null_in_when.on(reporterroron)); } }