fecc5ba501
If a potential receiver is resolved to an error type, we consider any other type as a subtype of it and therefore may select any candidate that we happen to find in a scope. In particular, in the case of scripts, or code with a context receiver, the receiver candidate resolved to a cycle was accepted as a receiver to an invoke on a random class from stdlib. The fix skips adding invoke resolve task in this case, allowing the tower to find the correct candidate in another scope. #KT-64241 fixed #KT-65576 fixed
19 lines
216 B
Kotlin
Vendored
19 lines
216 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
// !LANGUAGE: +ContextReceivers
|
|
// WITH_STDLIB
|
|
|
|
interface C
|
|
|
|
fun C.foo(body: () -> Unit) {}
|
|
|
|
context(C)
|
|
class A {
|
|
val foo = foo {}
|
|
}
|
|
|
|
fun C.test() {
|
|
object {
|
|
val foo = foo {}
|
|
}
|
|
}
|