Use more specific status to report diagnostics
#KT-12737 Fixed
This commit is contained in:
+2
-1
@@ -71,7 +71,8 @@ enum class ResolutionCandidateApplicability {
|
||||
MAY_THROW_RUNTIME_ERROR, // unsafe call or unstable smart cast
|
||||
RUNTIME_ERROR, // problems with visibility
|
||||
IMPOSSIBLE_TO_GENERATE, // access to outer class from nested
|
||||
INAPPLICABLE, // arguments not matched
|
||||
INAPPLICABLE, // arguments have wrong types
|
||||
INAPPLICABLE_ARGUMENTS_MAPPING_ERROR, // arguments not mapped to parameters (i.e. different size of arguments and parameters)
|
||||
INAPPLICABLE_WRONG_RECEIVER, // receiver not matched
|
||||
HIDDEN, // removed from resolve
|
||||
}
|
||||
|
||||
@@ -20,6 +20,11 @@ import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValueWithSmartCastInfo
|
||||
|
||||
private val INAPPLICABLE_STATUSES = setOf(
|
||||
ResolutionCandidateApplicability.INAPPLICABLE,
|
||||
ResolutionCandidateApplicability.INAPPLICABLE_ARGUMENTS_MAPPING_ERROR,
|
||||
ResolutionCandidateApplicability.INAPPLICABLE_WRONG_RECEIVER)
|
||||
|
||||
val ResolutionCandidateApplicability.isSuccess: Boolean
|
||||
get() = this <= ResolutionCandidateApplicability.RESOLVED_LOW_PRIORITY
|
||||
|
||||
@@ -30,7 +35,7 @@ val CandidateWithBoundDispatchReceiver.requiresExtensionReceiver: Boolean
|
||||
get() = descriptor.extensionReceiverParameter != null
|
||||
|
||||
val ResolutionCandidateApplicability.isInapplicable: Boolean
|
||||
get() = this == ResolutionCandidateApplicability.INAPPLICABLE || this == ResolutionCandidateApplicability.INAPPLICABLE_WRONG_RECEIVER
|
||||
get() = this in INAPPLICABLE_STATUSES
|
||||
|
||||
internal class CandidateWithBoundDispatchReceiverImpl(
|
||||
override val dispatchReceiver: ReceiverValueWithSmartCastInfo?,
|
||||
|
||||
Reference in New Issue
Block a user