[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,13 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun testObject() {
object : Foo(todo()) {
object : <!UNREACHABLE_CODE!>Foo(<!>todo()<!UNREACHABLE_CODE!>)<!> {
fun foo() = 1
}
}
fun testObjectExpression() {
val a = object : Foo(todo()) {
val <!UNUSED_VARIABLE!>a<!> = object : <!UNREACHABLE_CODE!>Foo(<!>todo()<!UNREACHABLE_CODE!>)<!> {
fun foo() = 1
}
}
@@ -15,13 +15,13 @@ fun testObjectExpression() {
fun testObjectExpression1() {
fun bar(i: Int, x: Any) {}
bar(1, object : Foo(todo()) {
bar(1, object : <!UNREACHABLE_CODE!>Foo(<!>todo()<!UNREACHABLE_CODE!>)<!> {
fun foo() = 1
})
}
fun testClassDeclaration() {
class C : Foo(todo()) {}
class C : <!UNREACHABLE_CODE!>Foo(<!>todo()<!UNREACHABLE_CODE!>)<!> {}
bar()
}
@@ -33,4 +33,4 @@ fun testFunctionDefaultArgument() {
open class Foo(i: Int) {}
fun todo(): Nothing = throw Exception()
fun bar() {}
fun bar() {}