FIR checker: introduce PARAMETER_* positioning strategies

and use them to add support diagnostics:
ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE
USELESS_VARARG_ON_PARAMETER
This commit is contained in:
Jinseong Jeon
2021-01-21 11:56:41 -08:00
committed by Mikhail Glukhikh
parent 33b7c68a21
commit 8b4f2b269c
16 changed files with 214 additions and 20 deletions
@@ -1,18 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -UNUSED_VARIABLE
val bar = fun(p: Int = 3) {}
val bas = fun(vararg p: Int) {}
fun gar() = fun(p: Int = 3) {}
fun gas() = fun(vararg p: Int) {}
fun outer(b: Any?) {
val bar = fun(p: Int = 3) {}
val bas = fun(vararg p: Int) {}
fun gar() = fun(p: Int = 3) {}
fun gas() = fun(vararg p: Int) {}
outer(fun(p: Int = 3) {})
outer(fun(vararg p: Int) {})
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -UNUSED_VARIABLE
val bar = fun(p: Int = <!ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE!>3<!>) {}