FIR checker: report UNINITIALIZED_PARAMETER

This commit is contained in:
Jinseong Jeon
2021-04-22 23:48:15 -07:00
committed by TeamCityServer
parent d2f831b635
commit bdfc879f00
21 changed files with 146 additions and 39 deletions
@@ -1,6 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo() {
fun bar(x: String, y: String = x) {}
fun baz(x: Int = <!UNRESOLVED_REFERENCE!>y<!>, y: Int) {}
}
@@ -1,6 +1,8 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo() {
fun foo(x: Int = <!UNINITIALIZED_PARAMETER!>x<!>) {}
fun bar(x: String, y: String = x) {}
fun baz(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int) {}
}
}
@@ -23,7 +23,7 @@ fun foo() {
10
}
fun bar(x: Exception = `_`) {}
class Bar(`_`: Exception = `_`) {
class Bar(`_`: Exception = <!UNINITIALIZED_PARAMETER!>`_`<!>) {
inner class Bar2(x: Exception = `_`) { }
}
}
@@ -23,7 +23,7 @@ fun foo() {
10
}
fun bar(x: Exception = `_`) {}
class Bar(`_`: Exception = `_`) {
class Bar(`_`: Exception = <!UNINITIALIZED_PARAMETER!>`_`<!>) {
inner class Bar2(x: Exception = `_`) { }
}
}