Report error for Result as an extension receiver with safe call
#KT-27620 Fixed
This commit is contained in:
+2
-1
@@ -21,7 +21,8 @@ class ResultTypeWithNullableOperatorsChecker : CallChecker {
|
||||
|
||||
when {
|
||||
operationNode?.elementType == KtTokens.SAFE_ACCESS -> {
|
||||
val receiver = resolvedCall.resultingDescriptor.dispatchReceiverParameter ?: return
|
||||
val resultingDescriptor = resolvedCall.resultingDescriptor
|
||||
val receiver = resultingDescriptor.extensionReceiverParameter ?: resultingDescriptor.dispatchReceiverParameter ?: return
|
||||
if (receiver.type.isResultType()) {
|
||||
context.trace.report(Errors.RESULT_CLASS_WITH_NULLABLE_OPERATOR.on(operationNode!!.psi, "?."))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user