Added a test on possible name clash for SAM wrappers

This commit is contained in:
Igor Chevdar
2020-06-04 18:47:35 +05:00
parent 66bbd3e102
commit 8b37a094fe
8 changed files with 65 additions and 0 deletions
@@ -0,0 +1,30 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// SKIP_DCE_DRIVEN
// FILE: lib.kt
fun interface Foo {
fun invoke(): String
}
// FILE: f1.kt
fun foo1(f: Foo) = f.invoke()
inline fun bar1(): String {
val f: () -> String = { "O" }
return foo1(Foo(f))
}
// FILE: f2.kt
fun foo2(f: Foo) = f.invoke()
inline fun bar2(): String {
val f: () -> String = { "K" }
return foo2(Foo(f))
}
// FILE: main.kt
fun box(): String = bar1() + bar2()