PSI2IR: SAM conversion should be performed once for index variables

Given esoteric code as in 'caoWithAdaptationForSam.kt', we should make
sure that we pass same objects to 'get' and 'set'.
This commit is contained in:
Dmitry Petrov
2020-01-28 17:12:50 +03:00
parent e750528551
commit bf9673a0a2
14 changed files with 689 additions and 125 deletions
@@ -0,0 +1,20 @@
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
fun interface IFoo {
fun foo(i: Int)
}
fun useFoo(foo: IFoo) {}
fun useVarargFoo(vararg foos: IFoo) {}
fun withVararg(vararg xs: Int) = 42
fun test() {
useFoo(::withVararg)
}
// TODO
//fun testVarargOfSams() {
// useVarargFoo(::withVararg)
//}