K2: process also arguments while calculating postponed atoms

#KT-61933 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-09-19 09:09:03 +02:00
committed by Space Team
parent 0c287c9945
commit 14bc20652e
4 changed files with 7 additions and 18 deletions
@@ -57,7 +57,7 @@ private class CalculatorForNestedCall(
private val typesToProcess: Queue<KotlinTypeMarker> = ArrayDeque()
private val postponedAtoms: List<PostponedResolvedAtom> by lazy {
candidate.postponedAtoms.filterNot { it.analyzed }
ConstraintSystemCompleter.getOrderedNotAnalyzedPostponedArguments(candidate)
}
fun computeCompletionMode(): ConstraintSystemCompletionMode = with(context) {
@@ -407,6 +407,11 @@ class ConstraintSystemCompleter(components: BodyResolveComponents, private val c
}
companion object {
internal fun getOrderedNotAnalyzedPostponedArguments(candidate: Candidate): List<PostponedResolvedAtom> {
val callSite = candidate.callInfo.callSite as? FirStatement ?: return emptyList()
return getOrderedNotAnalyzedPostponedArguments(listOf(callSite))
}
private fun getOrderedNotAnalyzedPostponedArguments(topLevelAtoms: List<FirStatement>): List<PostponedResolvedAtom> {
val notAnalyzedArguments = arrayListOf<PostponedResolvedAtom>()
for (primitive in topLevelAtoms) {
@@ -1,17 +0,0 @@
// ISSUE: KT-61933
data class Bar(
val foo: Foo<suspend () -> Unit>
)
data class Foo<out TCallback : Any>(
val state: TCallback?,
)
fun usage(b: Boolean) {
Bar(
foo = <!ARGUMENT_TYPE_MISMATCH!>Foo(
state = if (b) { -> } else null,
)<!>
)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-61933
data class Bar(