Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.fir.kt
T
Denis Zharkov f97cc0b62d FIR: Rework receivers processing in resolution
- Put extensionReceiver to candidate even if it's explicit (for sake of clarity)
- Split CheckReceiver (dispatch part should only check nullability)
2020-11-16 15:50:39 +03:00

37 lines
571 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_EXPRESSION,-UNUSED_VARIABLE
fun <T : CharSequence?> T.bar1() {}
fun CharSequence?.bar2() {}
fun <T : CharSequence> T.bar3() {}
fun CharSequence.bar4() {}
fun <T : String?> T.foo() {
if (this != null) {
if (this != null) {}
length
this?.length
bar1()
bar2()
bar3()
bar4()
this?.bar1()
}
<!INAPPLICABLE_CANDIDATE!>length<!>
if (this is String) {
length
this?.length
bar1()
bar2()
bar3()
}
}