Minor. Simplify conditions in shouldRunCompletion

This commit is contained in:
Denis.Zharkov
2021-01-29 18:41:03 +03:00
parent 173a852273
commit 29ac4cb9cc
2 changed files with 7 additions and 6 deletions
@@ -36,11 +36,13 @@ class FirBuilderInferenceSession(
val storage = system.getBuilder().currentStorage()
return !storage.notFixedTypeVariables.keys.any {
if (call.hasPostponed()) return true
return storage.notFixedTypeVariables.keys.all {
val variable = storage.allTypeVariables[it]
val isPostponed = variable != null && variable in storage.postponedTypeVariables
!isPostponed && !components.callCompleter.completer.variableFixationFinder.isTypeVariableHasProperConstraint(system, it)
} || call.hasPostponed()
isPostponed || components.callCompleter.completer.variableFixationFinder.isTypeVariableHasProperConstraint(system, it)
}
}
private fun FirStatement.hasPostponed(): Boolean {
@@ -6,7 +6,6 @@
package org.jetbrains.kotlin.resolve.calls.inference
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.impl.*
@@ -79,10 +78,10 @@ class CoroutineInferenceSession(
return true
}
return !storage.notFixedTypeVariables.keys.any {
return storage.notFixedTypeVariables.keys.all {
val variable = storage.allTypeVariables[it]
val isPostponed = variable != null && variable in storage.postponedTypeVariables
!isPostponed && !kotlinConstraintSystemCompleter.variableFixationFinder.isTypeVariableHasProperConstraint(
isPostponed || kotlinConstraintSystemCompleter.variableFixationFinder.isTypeVariableHasProperConstraint(
system,
it,
)