Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/takingExtensibilityFromDeclarationOfAnonymousFunction.kt
T
Pavel Kirpichenkov 712a2ce1ab [FIR] Improved lambda completion: initial implementation
Repeat the logic of KotlinConstraintSystemCompleter in ConstraintSystemCompleter.
Implement additional context operations required for updated lambda completion algorithm.
2020-10-13 11:00:21 +03:00

10 lines
310 B
Kotlin
Vendored

// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
fun <T> id(x: T) = x
fun <T> select(vararg x: T) = x[0]
val x1 = select(id { this }, fun Int.() = this)
val x2 = select(id { this + it.inv() }, fun Int.(x: Int) = this)
val x3 = select(id { this.length + it.inv() }, fun String.(x: Int) = length)