Unnecessary variable: do not suggest in case of name duplication
So #KT-20300 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
844dd1c43c
commit
b09465ca0b
@@ -0,0 +1,11 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(a: List<String>, b: List<Int>) {
|
||||
a.forEach {
|
||||
val <caret>a2 = it
|
||||
b.forEach {
|
||||
println(a2.length)
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// PROBLEM: none
|
||||
|
||||
interface Callback {
|
||||
fun on(id: Int)
|
||||
}
|
||||
|
||||
fun called(id: Int) {
|
||||
val <caret>calledId = id
|
||||
object : Callback {
|
||||
override fun on(id: Int) {
|
||||
if (id == calledId) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user