K2: process also arguments while calculating postponed atoms
#KT-61933 Fixed
This commit is contained in:
committed by
Space Team
parent
0c287c9945
commit
14bc20652e
+1
-1
@@ -57,7 +57,7 @@ private class CalculatorForNestedCall(
|
|||||||
private val typesToProcess: Queue<KotlinTypeMarker> = ArrayDeque()
|
private val typesToProcess: Queue<KotlinTypeMarker> = ArrayDeque()
|
||||||
|
|
||||||
private val postponedAtoms: List<PostponedResolvedAtom> by lazy {
|
private val postponedAtoms: List<PostponedResolvedAtom> by lazy {
|
||||||
candidate.postponedAtoms.filterNot { it.analyzed }
|
ConstraintSystemCompleter.getOrderedNotAnalyzedPostponedArguments(candidate)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun computeCompletionMode(): ConstraintSystemCompletionMode = with(context) {
|
fun computeCompletionMode(): ConstraintSystemCompletionMode = with(context) {
|
||||||
|
|||||||
+5
@@ -407,6 +407,11 @@ class ConstraintSystemCompleter(components: BodyResolveComponents, private val c
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
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> {
|
private fun getOrderedNotAnalyzedPostponedArguments(topLevelAtoms: List<FirStatement>): List<PostponedResolvedAtom> {
|
||||||
val notAnalyzedArguments = arrayListOf<PostponedResolvedAtom>()
|
val notAnalyzedArguments = arrayListOf<PostponedResolvedAtom>()
|
||||||
for (primitive in topLevelAtoms) {
|
for (primitive in topLevelAtoms) {
|
||||||
|
|||||||
-17
@@ -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
|
// ISSUE: KT-61933
|
||||||
|
|
||||||
data class Bar(
|
data class Bar(
|
||||||
|
|||||||
Reference in New Issue
Block a user