Files
kotlin-fork/idea/testData/intentions/convertLambdaToReference/unit.kt
T
Toshiaki Kameyama e822e871f5 KT-39532 Support intention to convert reference to lambda and vice versa for adapted references (#3495)
* Convert lambda to reference: support a function which has default parameters/unit return type/suspendability

#KT-39532 Fixed
2020-06-26 14:21:17 +03:00

11 lines
213 B
Kotlin
Vendored

// IS_APPLICABLE: false
// COMPILER_ARGUMENTS: -XXLanguage:-FunctionReferenceWithDefaultValueAsOtherType
fun Int.exec(f: (Int) -> Unit) = f(this)
fun bar(x: Int) = x
fun foo() {
2.exec {<caret> bar(it) }
}