4cbee3cde7
The issue was that, when various context elements were available to fulfill a need for an extension receiver, but none of them were applicable to it, the compiler behaved the same way as if there was no extension receiver at all. https://youtrack.jetbrains.com/issue/KT-51478/Inapplicable-receiver-diagnostic-expected-when-there-are-two-context-receiver-candidates
18 lines
266 B
Kotlin
Vendored
18 lines
266 B
Kotlin
Vendored
// !LANGUAGE: +ContextReceivers
|
|
// FIR_IDENTICAL
|
|
|
|
fun String.foo() {}
|
|
|
|
context(Int, Double)
|
|
fun bar() {
|
|
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>foo<!>() // should be prohibited
|
|
}
|
|
|
|
fun main() {
|
|
with(1) {
|
|
with(2.0) {
|
|
bar()
|
|
}
|
|
}
|
|
}
|