KT-53846 LT: Copy context receivers to secondary constructors

This commit is contained in:
Pavel Mikhailovskii
2023-02-20 18:13:54 +00:00
committed by Space Team
parent 873d9b565a
commit 752ba433cc
3 changed files with 1 additions and 4 deletions
@@ -1051,6 +1051,7 @@ class DeclarationsConverter(
val (body, _) = convertFunctionBody(block, null, allowLegacyContractDescription = true)
this.body = body
context.firFunctionTargets.removeLast()
this.contextReceivers.addAll(convertContextReceivers(secondaryConstructor.getParent()!!.getParent()!!))
}.also {
it.containingClassForStaticMemberAttr = currentDispatchReceiverType()!!.lookupTag
target.bind(it)
@@ -1,8 +1,6 @@
// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR
// Reason: KT-56508
// WITH_STDLIB
class A(val ok: String)
@@ -1,5 +1,3 @@
// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR
// Reason: KT-53846
// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR