Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/approximationOfInProjection.fir.kt
T
Kirill Rakhman 251827c9aa [FIR] Don't approximate captured types
This fixes some type argument mismatch errors caused by a captured type
being approximated and then captured again.
Some places need to be adapted to work with captured types that
previously only worked with approximated types.

#KT-62959 Fixed
2024-01-17 08:20:05 +00:00

15 lines
346 B
Kotlin
Vendored

// ISSUE: KT-21463
// SKIP_TXT
class Bound<T: Number>(val value: T)
fun test_1() {
val b: Bound<in Int> = Bound(1)
val vl: Number = <!DEBUG_INFO_EXPRESSION_TYPE("CapturedType(in kotlin.Int)")!>b.value<!>
}
fun test_2() {
val b: Bound<*> = Bound(1)
val vl: Number = <!DEBUG_INFO_EXPRESSION_TYPE("CapturedType(*)")!>b.value<!>
}