KT-2457 Verify error when comparing not null value with null in when
backend-side changes
This commit is contained in:
@@ -2848,7 +2848,7 @@ The "returned" value of try expression with no finally is either the last expres
|
||||
}
|
||||
else if (pattern instanceof JetExpressionPattern) {
|
||||
if (expressionToMatch != null) {
|
||||
final Type subjectType = expressionToMatch.type;
|
||||
Type subjectType = expressionToMatch.type;
|
||||
expressionToMatch.dupReceiver(v);
|
||||
expressionToMatch.put(subjectType, v);
|
||||
JetExpression condExpression = ((JetExpressionPattern) pattern).getExpression();
|
||||
@@ -2857,6 +2857,10 @@ The "returned" value of try expression with no finally is either the last expres
|
||||
Type condType;
|
||||
if (isNumberPrimitive(subjectType) || subjectType.getSort() == Type.BOOLEAN) {
|
||||
condType = asmType(condJetType);
|
||||
if (!(isNumberPrimitive(condType) || condType.getSort() == Type.BOOLEAN)) {
|
||||
subjectType = JetTypeMapper.boxType(subjectType);
|
||||
expressionToMatch.coerce(subjectType, v);
|
||||
}
|
||||
}
|
||||
else {
|
||||
condType = TYPE_OBJECT;
|
||||
|
||||
Reference in New Issue
Block a user