From c4b4912a71c6d78ab47e981756d7cf5d03ad25fe Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Tue, 21 Jul 2020 16:35:09 +0300 Subject: [PATCH] Revert "[PLUGIN API] Make `referenceClass` resolve type aliases too" --- .../backend/common/extensions/IrPluginContextImpl.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/extensions/IrPluginContextImpl.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/extensions/IrPluginContextImpl.kt index 8c808b4722e..1717527f1ca 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/extensions/IrPluginContextImpl.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/extensions/IrPluginContextImpl.kt @@ -78,12 +78,7 @@ open class IrPluginContextImpl( override fun referenceClass(fqName: FqName): IrClassSymbol? { assert(!fqName.isRoot) return resolveSymbol(fqName.parent()) { scope -> - val classifierDescriptor = scope.getContributedClassifier(fqName.shortName(), NoLookupLocation.FROM_BACKEND) - val classDescriptor = when (classifierDescriptor) { - is ClassDescriptor -> classifierDescriptor - is TypeAliasDescriptor -> classifierDescriptor.classDescriptor - else -> error("Unexpected classifier $classifierDescriptor") - } + val classDescriptor = scope.getContributedClassifier(fqName.shortName(), NoLookupLocation.FROM_BACKEND) as? ClassDescriptor? classDescriptor?.let { st.referenceClass(it) }