FIR: add resolve test for potential local scope problems

This commit is contained in:
Mikhail Glukhikh
2021-12-20 15:39:35 +03:00
committed by Space
parent b5b1b38cb0
commit 25f30cb3a9
5 changed files with 125 additions and 0 deletions
@@ -0,0 +1,31 @@
val x = object {
val someString = "123"
private fun foo(): Unit = with(someString) {
val presentations = mutableListOf<String>()
bar(true)?.let {
presentations.add(it)
}
}
private fun bar(arg: Boolean) = with(someString) {
if (arg) this else null
}
}
fun owner() {
class Local {
val someString = "123"
private fun foo(): Unit = with(someString) {
val presentations = mutableListOf<String>()
bar(true)?.let {
presentations.add(it)
}
}
private fun bar(arg: Boolean) = with(someString) {
if (arg) this else null
}
}
}