Remove restrictions for builder inference internal calls
This commit is contained in:
-17
@@ -126,23 +126,6 @@ class BuilderInferenceSession(
|
|||||||
if (skipCall(callInfo.callResolutionResult)) return
|
if (skipCall(callInfo.callResolutionResult)) return
|
||||||
|
|
||||||
commonCalls.add(callInfo)
|
commonCalls.add(callInfo)
|
||||||
|
|
||||||
val resultingDescriptor = callInfo.resolvedCall.resultingDescriptor
|
|
||||||
|
|
||||||
// This check is similar to one for old inference, see getCoroutineInferenceData() function
|
|
||||||
val checkCall = resultingDescriptor is LocalVariableDescriptor || anyReceiverContainStubType(resultingDescriptor)
|
|
||||||
|
|
||||||
if (!checkCall) return
|
|
||||||
|
|
||||||
val isApplicableCall =
|
|
||||||
callComponents.statelessCallbacks.isApplicableCallForBuilderInference(
|
|
||||||
resultingDescriptor,
|
|
||||||
callComponents.languageVersionSettings
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!isApplicableCall) {
|
|
||||||
hasInapplicableCall = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun anyReceiverContainStubType(descriptor: CallableDescriptor): Boolean {
|
private fun anyReceiverContainStubType(descriptor: CallableDescriptor): Boolean {
|
||||||
|
|||||||
-7
@@ -95,13 +95,6 @@ class KotlinResolutionStatelessCallbacksImpl(
|
|||||||
override fun isCoroutineCall(argument: KotlinCallArgument, parameter: ValueParameterDescriptor): Boolean =
|
override fun isCoroutineCall(argument: KotlinCallArgument, parameter: ValueParameterDescriptor): Boolean =
|
||||||
isCoroutineCallWithAdditionalInference(parameter, argument.psiCallArgument.valueArgument, languageVersionSettings)
|
isCoroutineCallWithAdditionalInference(parameter, argument.psiCallArgument.valueArgument, languageVersionSettings)
|
||||||
|
|
||||||
override fun isApplicableCallForBuilderInference(
|
|
||||||
descriptor: CallableDescriptor,
|
|
||||||
languageVersionSettings: LanguageVersionSettings,
|
|
||||||
): Boolean {
|
|
||||||
return org.jetbrains.kotlin.resolve.calls.inference.isApplicableCallForBuilderInference(descriptor, languageVersionSettings)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun isOldIntersectionIsEmpty(types: Collection<KotlinType>): Boolean {
|
override fun isOldIntersectionIsEmpty(types: Collection<KotlinType>): Boolean {
|
||||||
return TypeIntersector.intersectTypes(types) == null
|
return TypeIntersector.intersectTypes(types) == null
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -39,7 +39,6 @@ interface KotlinResolutionStatelessCallbacks {
|
|||||||
fun getScopeTowerForCallableReferenceArgument(argument: CallableReferenceKotlinCallArgument): ImplicitScopeTower
|
fun getScopeTowerForCallableReferenceArgument(argument: CallableReferenceKotlinCallArgument): ImplicitScopeTower
|
||||||
fun getVariableCandidateIfInvoke(functionCall: KotlinCall): KotlinResolutionCandidate?
|
fun getVariableCandidateIfInvoke(functionCall: KotlinCall): KotlinResolutionCandidate?
|
||||||
fun isCoroutineCall(argument: KotlinCallArgument, parameter: ValueParameterDescriptor): Boolean
|
fun isCoroutineCall(argument: KotlinCallArgument, parameter: ValueParameterDescriptor): Boolean
|
||||||
fun isApplicableCallForBuilderInference(descriptor: CallableDescriptor, languageVersionSettings: LanguageVersionSettings): Boolean
|
|
||||||
|
|
||||||
fun isOldIntersectionIsEmpty(types: Collection<KotlinType>): Boolean
|
fun isOldIntersectionIsEmpty(types: Collection<KotlinType>): Boolean
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user