Minor. Simplify conditions in shouldRunCompletion
This commit is contained in:
+5
-3
@@ -36,11 +36,13 @@ class FirBuilderInferenceSession(
|
|||||||
|
|
||||||
val storage = system.getBuilder().currentStorage()
|
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 variable = storage.allTypeVariables[it]
|
||||||
val isPostponed = variable != null && variable in storage.postponedTypeVariables
|
val isPostponed = variable != null && variable in storage.postponedTypeVariables
|
||||||
!isPostponed && !components.callCompleter.completer.variableFixationFinder.isTypeVariableHasProperConstraint(system, it)
|
isPostponed || components.callCompleter.completer.variableFixationFinder.isTypeVariableHasProperConstraint(system, it)
|
||||||
} || call.hasPostponed()
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirStatement.hasPostponed(): Boolean {
|
private fun FirStatement.hasPostponed(): Boolean {
|
||||||
|
|||||||
+2
-3
@@ -6,7 +6,6 @@
|
|||||||
package org.jetbrains.kotlin.resolve.calls.inference
|
package org.jetbrains.kotlin.resolve.calls.inference
|
||||||
|
|
||||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||||
import org.jetbrains.kotlin.config.LanguageFeature
|
|
||||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.impl.*
|
import org.jetbrains.kotlin.descriptors.impl.*
|
||||||
@@ -79,10 +78,10 @@ class CoroutineInferenceSession(
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return !storage.notFixedTypeVariables.keys.any {
|
return storage.notFixedTypeVariables.keys.all {
|
||||||
val variable = storage.allTypeVariables[it]
|
val variable = storage.allTypeVariables[it]
|
||||||
val isPostponed = variable != null && variable in storage.postponedTypeVariables
|
val isPostponed = variable != null && variable in storage.postponedTypeVariables
|
||||||
!isPostponed && !kotlinConstraintSystemCompleter.variableFixationFinder.isTypeVariableHasProperConstraint(
|
isPostponed || kotlinConstraintSystemCompleter.variableFixationFinder.isTypeVariableHasProperConstraint(
|
||||||
system,
|
system,
|
||||||
it,
|
it,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user