Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/invoke/implicitAndInvokeExtensionPriority.fir.kt
T
2023-07-01 16:29:04 +00:00

16 lines
496 B
Kotlin
Vendored

// ISSUE: KT-58943
class A {
fun bar() {
val foo: String.() -> Int = { 1 } // (1)
fun String.foo(): String = "" // (2)
with("2") {
// In K1, foo variable + invokeExtension on implicit receiver is more prioritized than `foo() + implicit receiver`
// So, for now, we're going to preserve that behavior in K2
// For design, see KT-59528
takeInt(<!ARGUMENT_TYPE_MISMATCH!>foo()<!>)
}
}
}
fun takeInt(x: Int) {}