[FIR] Add CAST_NEVER_SUCCEEDS

This commit is contained in:
Ivan Kochurkin
2021-09-16 20:58:52 +03:00
committed by TeamCityServer
parent 4ca757446a
commit 2b5524b18f
42 changed files with 206 additions and 273 deletions
@@ -43,7 +43,7 @@ fun f(a: SomeClass?) {
aa<!UNSAFE_CALL!>.<!>hashCode()
aa.<!UNRESOLVED_REFERENCE!>foo<!>
(aa as? SomeSubClass)<!UNSAFE_CALL!>.<!>foo
(aa as SomeSubClass).foo
(aa <!CAST_NEVER_SUCCEEDS!>as<!> SomeSubClass).foo
}
val b = (aa as? SomeSubClass)?.foo
aa = null
@@ -52,7 +52,7 @@ fun f(a: SomeClass?) {
aa<!UNSAFE_CALL!>.<!>hashCode()
aa.<!UNRESOLVED_REFERENCE!>foo<!>
(aa as? SomeSubClass)<!UNSAFE_CALL!>.<!>foo
(aa as SomeSubClass).foo
(aa <!CAST_NEVER_SUCCEEDS!>as<!> SomeSubClass).foo
}
aa = a
val c = aa as? SomeSubClass