Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"

This reverts commit 84334b08
This commit is contained in:
Dmitriy Novozhilov
2021-06-03 09:48:50 +03:00
parent 20d1a84002
commit 796f8e6bce
51 changed files with 297 additions and 308 deletions
@@ -0,0 +1,37 @@
// !CHECK_TYPE
interface A {
fun foo(): CharSequence?
fun baz(x: Any) {}
}
interface B {
fun foo(): String
fun baz(x: Int): String =""
fun baz(x: Int, y: Int) {}
fun foobar(): CharSequence?
}
interface C {
fun foo(): String
fun baz(x: Int): String =""
fun baz(x: Int, y: Int) {}
fun foobar(): String
}
var x: A = null!!
fun test() {
x.foo().checkType { _<CharSequence?>() }
if (x is B && x is C) {
x.foo().checkType { _<CharSequence?>() }
x.baz("")
x.baz(1).checkType { _<Unit>() }
x.baz(1, <!TOO_MANY_ARGUMENTS!>2<!>)
x.<!UNRESOLVED_REFERENCE!>foobar<!>().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
}
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// !CHECK_TYPE
interface A {