Fix SAM conversion when lambda is the last expression of another lambda

#KT-39691 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-07-20 10:36:37 +03:00
parent a15d3c76b6
commit 4083111dab
6 changed files with 79 additions and 0 deletions
@@ -0,0 +1,20 @@
// FIR_IDENTICAL
// FILE: C.java
public interface C { void on(String s); }
// FILE: A.java
public class A { void add(C c) {} }
// FILE: test.kt
class B : A() {
fun test(x: Any?) {
add(foo { { _ : String -> Unit } })
add(x?.let { { _ : String -> Unit } })
}
}
fun <T> foo(f: () -> T): T = f()