Introduce inapplicable wrong receiver status to improve diagnostics
#KT-10754 Fixed
This commit is contained in:
+1
-1
@@ -72,8 +72,8 @@ enum class ResolutionCandidateApplicability {
|
||||
RUNTIME_ERROR, // problems with visibility
|
||||
IMPOSSIBLE_TO_GENERATE, // access to outer class from nested
|
||||
INAPPLICABLE, // arguments not matched
|
||||
INAPPLICABLE_WRONG_RECEIVER, // receiver not matched
|
||||
HIDDEN, // removed from resolve
|
||||
// todo wrong receiver
|
||||
}
|
||||
|
||||
abstract class ResolutionDiagnostic(val candidateLevel: ResolutionCandidateApplicability)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,6 +29,9 @@ val CallableDescriptor.isSynthesized: Boolean
|
||||
val CandidateWithBoundDispatchReceiver.requiresExtensionReceiver: Boolean
|
||||
get() = descriptor.extensionReceiverParameter != null
|
||||
|
||||
val ResolutionCandidateApplicability.isInapplicable: Boolean
|
||||
get() = this == ResolutionCandidateApplicability.INAPPLICABLE || this == ResolutionCandidateApplicability.INAPPLICABLE_WRONG_RECEIVER
|
||||
|
||||
internal class CandidateWithBoundDispatchReceiverImpl(
|
||||
override val dispatchReceiver: ReceiverValueWithSmartCastInfo?,
|
||||
override val descriptor: CallableDescriptor,
|
||||
|
||||
Reference in New Issue
Block a user