[FIR] UNREACHABLE_CODE diagnostic (wip)

Implementation for PSI only
This commit is contained in:
Andrey Zinovyev
2021-07-29 12:39:47 +03:00
committed by TeamCityServer
parent dcd61c292d
commit ec4cbfef59
47 changed files with 348 additions and 220 deletions
@@ -1,18 +1,18 @@
fun testAssignment() {
var a = 1
a = todo()
var <!UNUSED_VARIABLE!>a<!> = 1
<!UNREACHABLE_CODE!><!ASSIGNED_VALUE_IS_NEVER_READ!>a<!> =<!> todo()
}
fun testVariableDeclaration() {
val a = todo()
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>a<!> =<!> todo()
}
fun testPlusAssign() {
operator fun Int.plusAssign(i: Int) {}
var a = 1
a += todo()
<!CAN_BE_VAL!>var<!> a = 1
a <!UNREACHABLE_CODE!>+=<!> todo()
}
fun todo(): Nothing = throw Exception()
fun todo(): Nothing = throw Exception()