From 0a18174165458425bcf22da9b17d7b9929f0f3cb Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 4 May 2021 20:58:33 +0200 Subject: [PATCH] IR: remove hack related to inline class representation in lazy IR This commit effectively reverts changes from b5f9b1dfc02713791783d07dce03e53833517c53, fixing the problem from KT-44723 in a stabler way. It is possible because we now serialize inline class representation to metadata and after previous changes, we have that representation as a field in IrClass. --- .../jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt index c17e6632e8d..47157ee4145 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt @@ -78,13 +78,7 @@ class IrLazyClass( private fun shouldBuildStub(descriptor: DeclarationDescriptor): Boolean = descriptor !is DeclarationDescriptorWithVisibility || - !DescriptorVisibilities.isPrivate(descriptor.visibility) || - // Always build lazy IR stubs for inline class primary constructors. - // This is needed because primary constructors of inline classes can be private, and prior to 1.5.0, there was no way - // to determine the inline class representation other than by loading the single value parameter of the primary constructor - // (corresponding metadata entry was added in 1.5.0). Backend still tries to load inline class representation in this way - // to support compilation against inline classes compiled with 1.4.30 or earlier. - (descriptor is ConstructorDescriptor && isInline) + !DescriptorVisibilities.isPrivate(descriptor.visibility) override var typeParameters: List by lazyVar(stubGenerator.lock) { descriptor.declaredTypeParameters.mapTo(arrayListOf()) {