Support definitely-not-null generic T!! types in Parsing and FE1.0
^KT-26245 In Progress
This commit is contained in:
committed by
TeamCityServer
parent
5a0b75bd89
commit
b9d2a1842a
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user