diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/TypeAliasDeserializer.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/TypeAliasDeserializer.kt deleted file mode 100644 index 06566f3fabb..00000000000 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/TypeAliasDeserializer.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.serialization.deserialization - -import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor -import org.jetbrains.kotlin.incremental.components.NoLookupLocation -import org.jetbrains.kotlin.name.ClassId - -class TypeAliasDeserializer(private val components: DeserializationComponents) { - - fun deserializeTypeAlias(typeAliasId: ClassId): TypeAliasDescriptor? { - val parentScope = if (typeAliasId.isNestedClass) { - val outerClass = components.classDeserializer.deserializeClass(typeAliasId.outerClassId) ?: return null - outerClass.unsubstitutedMemberScope - } - else { - val packageFragment = components.packageFragmentProvider.getPackageFragments(typeAliasId.packageFqName).single() - packageFragment.getMemberScope() - } - - return parentScope.getContributedClassifier(typeAliasId.shortClassName, NoLookupLocation.FROM_DESERIALIZATION) as? TypeAliasDescriptor - } - -} diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/TypeDeserializer.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/TypeDeserializer.kt index c5a3db8d0af..6cbc6a5c1a7 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/TypeDeserializer.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/TypeDeserializer.kt @@ -147,7 +147,8 @@ class TypeDeserializer( private fun computeTypeAliasDescriptor(fqNameIndex: Int): ClassifierDescriptor? { val id = c.nameResolver.getClassId(fqNameIndex) return if (id.isLocal) { - c.components.deserializeTypeAlias(id) + // TODO: support deserialization of local type aliases (see KT-13692) + return null } else { c.components.moduleDescriptor.findTypeAliasAcrossModuleDependencies(id) diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/context.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/context.kt index a65ad3b8f0f..54bc2f9263e 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/context.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/context.kt @@ -41,7 +41,6 @@ class DeserializationComponents( val platformDependentDeclarationFilter: PlatformDependentDeclarationFilter = PlatformDependentDeclarationFilter.All ) { val classDeserializer: ClassDeserializer = ClassDeserializer(this) - val typeAliasDeserializer: TypeAliasDeserializer = TypeAliasDeserializer(this) fun deserializeClass(classId: ClassId): ClassDescriptor? = classDeserializer.deserializeClass(classId) @@ -53,8 +52,6 @@ class DeserializationComponents( ): DeserializationContext = DeserializationContext(this, nameResolver, descriptor, typeTable, containerSource, parentTypeDeserializer = null, typeParameters = listOf()) - - fun deserializeTypeAlias(typeAliasId: ClassId): TypeAliasDescriptor? = typeAliasDeserializer.deserializeTypeAlias(typeAliasId) }