KT-51863 Account for context receivers in calls with changed parameter order

This commit is contained in:
Pavel Mikhailovskii
2022-12-06 16:28:08 +00:00
committed by Space Team
parent e9984ce38d
commit 25ad7fe31c
4 changed files with 40 additions and 8 deletions
@@ -0,0 +1,20 @@
// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
import kotlin.test.*
context(String, List<String>)
fun test(x: Any, y: Int = 0): List<Any> = listOf(this@String, this@List, x, y)
fun box(): String {
with("context1") {
with(listOf("context2")) {
assertEquals(
listOf("context1", listOf("context2"), listOf(1), 1),
test(y = 1, x = listOf(1))
)
}
}
return "OK"
}