Convert lambda to reference: fix it works correctly in anonymous object

#KT-31682 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-05-28 09:32:18 +09:00
committed by Yan Zhulanow
parent b9fab1123d
commit 8f3392d635
6 changed files with 76 additions and 0 deletions
@@ -0,0 +1,17 @@
interface I {
fun foo(i: Int)
}
class C {
fun create(): I {
return object : I {
override fun foo(i: Int) {
bar {<caret> baz(it) }
}
fun bar(f: (Int) -> Unit) {}
fun baz(i: Int) {}
}
}
}