Files
kotlin-fork/compiler/testData/diagnostics/tests/explicitDefinitelyNotNull/approximation.fir.kt
T
Denis.Zharkov 37f923a98f Do not approximate DefinitelyNotNullType in public declarations
Because since 1.6 they become normal denotable types

^KT-26245 Fixed
2021-04-09 13:06:37 +03:00

15 lines
333 B
Kotlin
Vendored

// !LANGUAGE: +DefinitelyNotNullTypeParameters
fun <T> foo(x: T, y: T!!) = x!!
fun main() {
foo<String>("", "").length
<!INAPPLICABLE_CANDIDATE!>foo<!><String>("", null).length
foo<String?>(null, "").length
foo<String?>(null, null).length
foo("", "").length
foo("", null).length
foo(null, "").length
}