Fix JetType.equals(): flexible types are not equal to non-flexible ones, when we store them in a HashSet
This commit is contained in:
+6
-1
@@ -1081,7 +1081,12 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
JetType type = resolvedCall.getResultingDescriptor().getReturnType();
|
||||
if (type == null || rightType == null) return JetTypeInfo.create(null, dataFlowInfo);
|
||||
|
||||
return JetTypeInfo.create(TypeUtils.makeNullableAsSpecified(type, rightType.isNullable()), dataFlowInfo);
|
||||
// Sometimes return type for special call for elvis operator might be nullable,
|
||||
// but result is not nullable if the right type is not nullable
|
||||
if (!TypeUtils.isNullableType(rightType) && TypeUtils.isNullableType(type)) {
|
||||
type = TypeUtils.makeNotNullable(type);
|
||||
}
|
||||
return JetTypeInfo.create(type, dataFlowInfo);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user