Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/invoke/closerVariableMatterMore.kt
T
Denis.Zharkov 1f120ecd20 K2: Adjust invoke priorities with K1
- At first, get rid of a kind of interceptTowerGroup callback and use
explicit towerGroup construction instead
- Get rid of INVOKE_RECEIVER (not sure exactly why it was needed)
- Make comparison consistent with tower-levels priority of K2
(see the comments in the compareTo code)

^KT-37375 Fixed
^KT-58940 Open
2023-07-01 16:29:05 +00:00

15 lines
306 B
Kotlin
Vendored

// FIR_IDENTICAL
// ISSUE: KT-37375
fun takeDouble(x: Double) {}
val bar: Int = 1
operator fun Double.invoke(): Double = 1.0 // (1)
fun test_1() {
val bar: Double = 2.0
operator fun Int.invoke(): Int = 1 // (2)
val res = bar() // should resolve to (1)
takeDouble(res) // should be OK
}