FIR: Fix candidate receivers orders when choosing a context receiver
^KT-53257 Fixed
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
class A(val x: String)
|
||||
|
||||
var result = ""
|
||||
|
||||
context(A)
|
||||
fun foo() {
|
||||
result += x
|
||||
}
|
||||
|
||||
fun A.bar() {
|
||||
foo()
|
||||
baz {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun baz(a: A.() -> Unit) {
|
||||
a(A("K"))
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
A("O").bar() // prints "1", "1" while "1", "2" is expected
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user