4726dcce40
In order to make resolution still work for members not available from `Nothing`, we track the type without `Nothing?` and use that for resolution instead.
26 lines
435 B
Kotlin
Vendored
26 lines
435 B
Kotlin
Vendored
fun foo(x: String?) = x
|
|
|
|
class Test
|
|
|
|
class TestWithEquals {
|
|
override fun equals(other: Any?) = super.equals(other)
|
|
}
|
|
|
|
fun bar(i: Test?) {
|
|
if (i == null) foo(i)
|
|
}
|
|
|
|
fun bar(i: TestWithEquals?) {
|
|
if (i == null) foo(i)
|
|
if (null == i) foo(i)
|
|
when (i) {
|
|
null -> foo(i)
|
|
}
|
|
}
|
|
|
|
fun gav(i: TestWithEquals?, j: TestWithEquals?) {
|
|
if (j == null) {
|
|
if (i == j) foo(<!ARGUMENT_TYPE_MISMATCH!>i<!>)
|
|
}
|
|
}
|