Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/classObjectMember.fir.kt
T
simon.ogorodnik 34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00

22 lines
272 B
Kotlin
Vendored

open class T {
val x : Int? = null
}
class A {
companion object: T() {
}
}
class B {
companion object: T() {
}
}
fun test() {
if (A.x != null) {
useInt(A.x)
<!INAPPLICABLE_CANDIDATE!>useInt<!>(B.x)
}
}
fun useInt(i: Int) = i