Simplify canBeCalledWith function
This commit is contained in:
committed by
Ilya Kirillov
parent
b90503decb
commit
e3778d62e3
+2
-2
@@ -76,8 +76,8 @@ private object KotlinHighLevelApiContributor : CompletionProvider<CompletionPara
|
||||
}
|
||||
|
||||
private fun KtCallableSymbol.canBeCalledWith(implicitReceivers: List<KtType>): Boolean {
|
||||
require(this is KtPossibleExtensionSymbol && this.isExtension) { "This function should be called only on extensions!" }
|
||||
val requiredReceiverType = (this as? KtPossibleExtensionSymbol)?.receiverType
|
||||
?: error("Extension receiver type should be present on ${this}")
|
||||
|
||||
val requiredReceiverType = receiverType ?: error("Receiver type should be present")
|
||||
return implicitReceivers.any { it.isSubTypeOf(requiredReceiverType) }
|
||||
}
|
||||
Reference in New Issue
Block a user