Files
kotlin-fork/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/nullableReceiverWithOverloadedMethod.fir.kt
T
2020-01-22 14:49:22 +03:00

29 lines
523 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
class A {
fun f(x: Boolean): Int = 0
fun f(y: String): Int = 0
}
class B {
private var a: A? = null
fun takeInt(i: Int) {}
fun f() {
a = A()
a.<!INAPPLICABLE_CANDIDATE!>f<!>(true)
takeInt(a.<!INAPPLICABLE_CANDIDATE!>f<!>(""))
a.<!INAPPLICABLE_CANDIDATE!>f<!>()
}
fun g() {
takeInt(if (3 > 2) {
a = A()
a.<!INAPPLICABLE_CANDIDATE!>f<!>(true)
} else {
6
})
}
}