Fix incorrect "senseless null in when" on nullable type
This commit is contained in:
+1
-1
@@ -320,7 +320,7 @@ public class PatternMatchingTypingVisitor extends ExpressionTypingVisitor {
|
||||
}
|
||||
|
||||
// check if the pattern is essentially a 'null' expression
|
||||
if (KotlinBuiltIns.getInstance().isNullableNothing(type) && !subjectType.isNullable()) {
|
||||
if (KotlinBuiltIns.getInstance().isNullableNothing(type) && !TypeUtils.isNullableType(subjectType)) {
|
||||
context.trace.report(SENSELESS_NULL_IN_WHEN.on(reportErrorOn));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user