Check lambda parameter for name shadowing

#KT-5160 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-04-17 10:40:41 +03:00
parent 708bfdbd5f
commit 32f609ceee
15 changed files with 61 additions and 19 deletions
@@ -0,0 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo1(i: (Int) -> Unit) {}
fun foo2(i: (Int, Int) -> Unit) {}
fun foo3(i: (Pair) -> Unit) {}
fun bar(x: Int, y: Int) {
foo1 { <!NAME_SHADOWING!>x<!> -> <!UNUSED_EXPRESSION!>x<!> }
foo2 { <!NAME_SHADOWING!>x<!>: Int, <!NAME_SHADOWING!>y<!>: Int -> x + y }
foo3 { (x, y) -> x + y }
}
data class Pair(val a: Int, val b: Int)