Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotationWithUpperBoundConstraint.fir.kt
T
Denis.Zharkov 883b18a0c6 FIR: Preserve non-custom attributes after substitution
The test is being fixed since synthetic call for elvis has @Exact-attribute on return type
2021-11-26 19:39:45 +03:00

18 lines
634 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER -DEBUG_INFO_CONSTANT -UNUSED_EXPRESSION
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
fun <@kotlin.internal.OnlyInputTypes K, V, V1 : V?>
Map<out K, @kotlin.internal.Exact V>.getOrDefault_Exact(key: K, defaultValue: V1): V1 = TODO()
fun test() {
val map: Map<String, Int> = mapOf("x" to 1)
val r1 = map.getOrDefault_Exact("y", null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>r1<!>
val r2 = map.getOrDefault_Exact("y", null as Int?)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>r2<!>
map.getOrDefault_Exact("y", <!ARGUMENT_TYPE_MISMATCH!>"string"<!>)
}