Support definitely-not-null generic T!! types in Parsing and FE1.0

^KT-26245 In Progress
This commit is contained in:
Denis.Zharkov
2021-04-06 17:41:32 +03:00
committed by TeamCityServer
parent 5a0b75bd89
commit b9d2a1842a
34 changed files with 815 additions and 17 deletions
@@ -0,0 +1,14 @@
// !LANGUAGE: +DefinitelyNotNullTypeParameters
fun <T> foo(x: T, y: T!!): T!! = x ?: y
fun main() {
foo<String>("", "").length
<!INAPPLICABLE_CANDIDATE!>foo<!><String>("", null).length
foo<String?>(null, "")<!UNSAFE_CALL!>.<!>length
foo<String?>(null, null)<!UNSAFE_CALL!>.<!>length
foo("", "").length
foo("", null)<!UNSAFE_CALL!>.<!>length
foo(null, "")<!UNSAFE_CALL!>.<!>length
}