KT-53846 Pass context receivers to secondary constructors
This commit is contained in:
committed by
Space Team
parent
bd3a28d04d
commit
57ddb9fddf
@@ -1,7 +1,6 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K2: JVM_IR, JS_IR
|
||||
// FIR status: context receivers aren't yet supported
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
class A(val ok: String)
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user