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:
+20
@@ -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)
|
||||
//}
|
||||
Reference in New Issue
Block a user