Unused symbol: do not use body of function literal as scope for members

So #KT-10546 Fixed
This commit is contained in:
Mikhail Glukhikh
2017-09-11 13:25:17 +03:00
committed by Mikhail Glukhikh
parent 4b25317ecb
commit 7ae722492f
4 changed files with 50 additions and 2 deletions
@@ -0,0 +1,16 @@
// PROBLEM: none
// WITH_RUNTIME
fun foo() {
val xs = listOf(1, 2, 3).flatMap { x ->
listOf(3, 4, 5).map { y ->
object {
val <caret>value = x + y
}
}
}
xs.forEach {
println("value: " + it.value)
}
}
@@ -0,0 +1,12 @@
// PROBLEM: none
// WITH_RUNTIME
fun testDC(): String {
val x = run {
object {
val <caret>users = "XXX"
}
}
return x.users
}