Files
kotlin/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.kt
Victor Petukhov 7f7bb70596 Don't fix a type variable into the intersection type if there is an explicit expected type
^KT-43303 Fixed
^KT-42396 Fixed
^KT-42472 Fixed
2021-03-12 14:36:53 +03:00

13 lines
380 B
Kotlin
Vendored

//!DIAGNOSTICS: -UNUSED_VARIABLE
// !WITH_NEW_INFERENCE
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
fun <T, U: T> List<@kotlin.internal.Exact T>.firstTyped(): U = throw Exception()
fun test1(l: List<Number>) {
val i: Int = l.firstTyped()
val s: String = <!TYPE_MISMATCH!>l.<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH{OI}!><!TYPE_MISMATCH!>firstTyped<!>()<!><!>
}