FE: perform IOT approximation after resolution & inference

#KT-54917 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-06-20 15:43:46 +02:00
committed by Space Team
parent 7884d9a61e
commit fa6b1e24f9
4 changed files with 4 additions and 11 deletions
@@ -105,6 +105,7 @@ open class TypeApproximatorConfiguration {
object FinalApproximationAfterResolutionAndInference :
AbstractCapturedTypesApproximation(CaptureStatus.FROM_EXPRESSION) {
override val integerLiteralConstantType: Boolean get() = true
override val integerConstantOperatorType: Boolean get() = true
override val intersectionTypesInContravariantPositions: Boolean get() = true
override val convertToNonRawVersionAfterApproximationInK2: Boolean get() = true
@@ -1,9 +0,0 @@
// WITH_STDLIB
// FIR_DUMP
fun foo() {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.List<IOT>")!>foo(1 to 2)<!>
val x = foo(3 to 4)
}
fun <T : Comparable<T>> foo(vararg values: Pair<T, T>): List<T> = TODO()
@@ -1,7 +1,7 @@
FILE: literalInCompletedGeneric.fir.kt
FILE: literalInCompletedGeneric.kt
public final fun foo(): R|kotlin/Unit| {
R|/foo|<R|kotlin/Int|>(vararg(Int(1).R|kotlin/to|<R|kotlin/Int|, R|kotlin/Int|>(Int(2))))
lval x: R|kotlin/collections/List<IOT>| = R|/foo|<R|kotlin/Int|>(vararg(Int(3).R|kotlin/to|<R|kotlin/Int|, R|kotlin/Int|>(Int(4))))
lval x: R|kotlin/collections/List<kotlin/Int>| = R|/foo|<R|kotlin/Int|>(vararg(Int(3).R|kotlin/to|<R|kotlin/Int|, R|kotlin/Int|>(Int(4))))
}
public final fun <T : R|kotlin/Comparable<T>|> foo(vararg values: R|kotlin/Array<out kotlin/Pair<T, T>>|): R|kotlin/collections/List<T>| {
^foo R|kotlin/TODO|()
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// WITH_STDLIB
// FIR_DUMP