KT-53846 Pass context receivers to secondary constructors

This commit is contained in:
Pavel Mikhailovskii
2022-12-09 15:24:56 +00:00
committed by Space Team
parent bd3a28d04d
commit 57ddb9fddf
5 changed files with 31 additions and 2 deletions
@@ -0,0 +1,17 @@
// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
fun box(): String {
with(Ctx()) {
Foo()
}
return "OK"
}
context(Ctx)
class Foo private constructor(i: Int) {
constructor() : this(1)
}
class Ctx