From e4d3a651241de6a67a9cff44f45199c12ad23a9f Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Wed, 26 Nov 2014 18:36:34 +0300 Subject: [PATCH] Make AnnotationLoader and ConstantLoader accept descriptor-independent data Rewrite BaseDescriptorLoader to operate on data derived from proto Intdoduce ProtoContainer to replace containing descriptor as input data --- .../kotlin/AnnotationDescriptorLoader.java | 13 +- .../resolve/kotlin/BaseDescriptorLoader.kt | 117 ++++++++---------- .../kotlin/ConstantDescriptorLoader.java | 6 +- .../serialization/MemberDeserializer.kt | 18 +-- .../descriptors/AnnotationLoader.java | 12 +- .../descriptors/ConstantLoader.java | 5 +- .../DeserializedClassDescriptor.kt | 4 +- .../descriptors/ProtoContainer.kt | 26 ++++ 8 files changed, 108 insertions(+), 93 deletions(-) create mode 100644 core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/ProtoContainer.kt diff --git a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/AnnotationDescriptorLoader.java b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/AnnotationDescriptorLoader.java index fe6519f8ea3..2f5dbc6c295 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/AnnotationDescriptorLoader.java +++ b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/AnnotationDescriptorLoader.java @@ -24,6 +24,7 @@ import org.jetbrains.jet.descriptors.serialization.ProtoBuf; import org.jetbrains.jet.descriptors.serialization.SerializationPackage; import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotatedCallableKind; import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationLoader; +import org.jetbrains.jet.descriptors.serialization.descriptors.ProtoContainer; import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptorImpl; @@ -57,15 +58,15 @@ public class AnnotationDescriptorLoader extends BaseDescriptorLoader implements @NotNull @Override public List loadClassAnnotations( - @NotNull ClassDescriptor descriptor, @NotNull ProtoBuf.Class classProto, @NotNull NameResolver nameResolver ) { - KotlinJvmBinaryClass kotlinClass = findKotlinClassByDescriptor(descriptor); + ClassId classId = nameResolver.getClassId(classProto.getFqName()); + KotlinJvmBinaryClass kotlinClass = findKotlinClassById(classId); if (kotlinClass == null) { // This means that the resource we're constructing the descriptor from is no longer present: KotlinClassFinder had found the // class earlier, but it can't now - getErrorReporter().reportLoadingError("Kotlin class for loading class annotations is not found: " + descriptor, null); + getErrorReporter().reportLoadingError("Kotlin class for loading class annotations is not found: " + classId.asSingleFqName(), null); return Collections.emptyList(); } @@ -183,7 +184,7 @@ public class AnnotationDescriptorLoader extends BaseDescriptorLoader implements @NotNull @Override public List loadCallableAnnotations( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable proto, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind @@ -196,7 +197,7 @@ public class AnnotationDescriptorLoader extends BaseDescriptorLoader implements @NotNull private List findClassAndLoadMemberAnnotations( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable proto, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind, @@ -215,7 +216,7 @@ public class AnnotationDescriptorLoader extends BaseDescriptorLoader implements @NotNull @Override public List loadValueParameterAnnotations( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable callable, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind, diff --git a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/BaseDescriptorLoader.kt b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/BaseDescriptorLoader.kt index 9bcef3f081c..2df45c1e448 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/BaseDescriptorLoader.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/BaseDescriptorLoader.kt @@ -20,21 +20,14 @@ import org.jetbrains.jet.descriptors.serialization.JavaProtoBuf.*; import org.jetbrains.jet.descriptors.serialization.NameResolver; import org.jetbrains.jet.descriptors.serialization.ProtoBuf; import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotatedCallableKind; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.ClassOrPackageFragmentDescriptor; -import org.jetbrains.jet.lang.descriptors.PackageFragmentDescriptor; -import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.java.resolver.ErrorReporter; import org.jetbrains.jet.lang.resolve.name.ClassId; -import org.jetbrains.jet.lang.resolve.DescriptorUtils.isClassObject -import org.jetbrains.jet.lang.resolve.DescriptorUtils.isTrait -import org.jetbrains.jet.lang.resolve.java.PackageClassUtils.getPackageClassId import org.jetbrains.jet.lang.resolve.kotlin.DescriptorLoadersStorage.MemberSignature -import org.jetbrains.jet.lang.resolve.kotlin.DeserializedResolverUtils.getClassId import org.jetbrains.jet.lang.resolve.kotlin.DeserializedResolverUtils.kotlinClassIdToJavaClassId -import kotlin.platform.platformStatic -import org.jetbrains.kotlin.util.sure +import org.jetbrains.jet.descriptors.serialization.descriptors.ProtoContainer +import org.jetbrains.jet.descriptors.serialization.Flags +import org.jetbrains.jet.lang.resolve.name.FqName public abstract class BaseDescriptorLoader protected( private val kotlinClassFinder: KotlinClassFinder, @@ -43,88 +36,86 @@ public abstract class BaseDescriptorLoader protected( ) { protected fun findClassWithAnnotationsAndInitializers( - container: ClassOrPackageFragmentDescriptor, + container: ProtoContainer, proto: ProtoBuf.Callable, nameResolver: NameResolver, - kind: AnnotatedCallableKind + annotatedCallableKind: AnnotatedCallableKind ): KotlinJvmBinaryClass? { - if (container is PackageFragmentDescriptor) { - return findPackagePartClass(container, proto, nameResolver) + val packageFqName = container.packageFqName + if (packageFqName != null) { + return findPackagePartClass(packageFqName, proto, nameResolver) } - else if (isClassObject(container) && isStaticFieldInOuter(proto)) { + val classProto = container.classProto!! + val classKind = Flags.CLASS_KIND[classProto.getFlags()] + val classId = nameResolver.getClassId(classProto.getFqName()) + if (classKind == ProtoBuf.Class.Kind.CLASS_OBJECT && isStaticFieldInOuter(proto)) { // Backing fields of properties of a class object are generated in the outer class - return findKotlinClassByDescriptor(container.getContainingDeclaration() as ClassOrPackageFragmentDescriptor) + return findKotlinClassById(classId.getOuterClassId()) } - else if (isTrait(container) && kind == AnnotatedCallableKind.PROPERTY) { + else if (classKind == ProtoBuf.Class.Kind.TRAIT && annotatedCallableKind == AnnotatedCallableKind.PROPERTY) { if (proto.hasExtension(implClassName)) { - val packageFqName = getClassId(container as ClassDescriptor).getPackageFqName() + val parentPackageFqName = classId.getPackageFqName() val tImplName = nameResolver.getName(proto.getExtension(implClassName)) // TODO: store accurate name for nested traits - return kotlinClassFinder.findKotlinClass(ClassId(packageFqName, tImplName)) + return findKotlinClassById(ClassId(parentPackageFqName, tImplName)) } return null } - return findKotlinClassByDescriptor(container) + return findKotlinClassById(classId) } private fun findPackagePartClass( - container: PackageFragmentDescriptor, + packageFqName: FqName, proto: ProtoBuf.Callable, nameResolver: NameResolver ): KotlinJvmBinaryClass? { if (proto.hasExtension(implClassName)) { - return kotlinClassFinder.findKotlinClass(ClassId(container.fqName, nameResolver.getName(proto.getExtension(implClassName)))) + return findKotlinClassById(ClassId(packageFqName, nameResolver.getName(proto.getExtension(implClassName)))) } return null } - protected fun findKotlinClassByDescriptor(descriptor: ClassOrPackageFragmentDescriptor): KotlinJvmBinaryClass? { - return when (descriptor) { - is ClassDescriptor -> kotlinClassFinder.findKotlinClass(kotlinClassIdToJavaClassId(getClassId(descriptor))) - is PackageFragmentDescriptor -> kotlinClassFinder.findKotlinClass(getPackageClassId((descriptor).fqName)) - else -> throw IllegalStateException("Unrecognized descriptor: " + descriptor) - } + protected fun findKotlinClassById(classId: ClassId): KotlinJvmBinaryClass? { + return kotlinClassFinder.findKotlinClass(kotlinClassIdToJavaClassId(classId)) } - class object { - platformStatic fun getCallableSignature( - proto: ProtoBuf.Callable, - nameResolver: NameResolver, - kind: AnnotatedCallableKind - ): MemberSignature? { - val deserializer = SignatureDeserializer(nameResolver) - when (kind) { - AnnotatedCallableKind.FUNCTION -> if (proto.hasExtension(methodSignature)) { - return deserializer.methodSignature(proto.getExtension(methodSignature)) - } - AnnotatedCallableKind.PROPERTY_GETTER -> if (proto.hasExtension(propertySignature)) { - return deserializer.methodSignature(proto.getExtension(propertySignature).getGetter()) - } - AnnotatedCallableKind.PROPERTY_SETTER -> if (proto.hasExtension(propertySignature)) { - return deserializer.methodSignature(proto.getExtension(propertySignature).getSetter()) - } - AnnotatedCallableKind.PROPERTY -> if (proto.hasExtension(propertySignature)) { - val propertySignature = proto.getExtension(propertySignature) + private fun isStaticFieldInOuter(proto: ProtoBuf.Callable): Boolean { + if (!proto.hasExtension(propertySignature)) return false + val propertySignature = proto.getExtension(propertySignature) + return propertySignature.hasField() && propertySignature.getField().getIsStaticInOuter() + } - if (propertySignature.hasField()) { - val field = propertySignature.getField() - val type = deserializer.typeDescriptor(field.getType()) - val name = nameResolver.getName(field.getName()) - return MemberSignature.fromFieldNameAndDesc(name, type) - } - else if (propertySignature.hasSyntheticMethod()) { - return deserializer.methodSignature(propertySignature.getSyntheticMethod()) - } + fun getCallableSignature( + proto: ProtoBuf.Callable, + nameResolver: NameResolver, + kind: AnnotatedCallableKind + ): MemberSignature? { + val deserializer = SignatureDeserializer(nameResolver) + when (kind) { + AnnotatedCallableKind.FUNCTION -> if (proto.hasExtension(methodSignature)) { + return deserializer.methodSignature(proto.getExtension(methodSignature)) + } + AnnotatedCallableKind.PROPERTY_GETTER -> if (proto.hasExtension(propertySignature)) { + return deserializer.methodSignature(proto.getExtension(propertySignature).getGetter()) + } + AnnotatedCallableKind.PROPERTY_SETTER -> if (proto.hasExtension(propertySignature)) { + return deserializer.methodSignature(proto.getExtension(propertySignature).getSetter()) + } + AnnotatedCallableKind.PROPERTY -> if (proto.hasExtension(propertySignature)) { + val propertySignature = proto.getExtension(propertySignature) + + if (propertySignature.hasField()) { + val field = propertySignature.getField() + val type = deserializer.typeDescriptor(field.getType()) + val name = nameResolver.getName(field.getName()) + return MemberSignature.fromFieldNameAndDesc(name, type) + } + else if (propertySignature.hasSyntheticMethod()) { + return deserializer.methodSignature(propertySignature.getSyntheticMethod()) } } - return null - } - - private fun isStaticFieldInOuter(proto: ProtoBuf.Callable): Boolean { - if (!proto.hasExtension(propertySignature)) return false - val propertySignature = proto.getExtension(propertySignature) - return propertySignature.hasField() && propertySignature.getField().getIsStaticInOuter() } + return null } } diff --git a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/ConstantDescriptorLoader.java b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/ConstantDescriptorLoader.java index 476400797b0..704d404da15 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/ConstantDescriptorLoader.java +++ b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/ConstantDescriptorLoader.java @@ -22,7 +22,7 @@ import org.jetbrains.jet.descriptors.serialization.NameResolver; import org.jetbrains.jet.descriptors.serialization.ProtoBuf; import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotatedCallableKind; import org.jetbrains.jet.descriptors.serialization.descriptors.ConstantLoader; -import org.jetbrains.jet.lang.descriptors.ClassOrPackageFragmentDescriptor; +import org.jetbrains.jet.descriptors.serialization.descriptors.ProtoContainer; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; import org.jetbrains.jet.lang.resolve.java.resolver.ErrorReporter; @@ -40,12 +40,12 @@ public class ConstantDescriptorLoader extends BaseDescriptorLoader implements Co @Nullable @Override public CompileTimeConstant loadPropertyConstant( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable proto, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind ) { - MemberSignature signature = BaseDescriptorLoader.getCallableSignature(proto, nameResolver, kind); + MemberSignature signature = getCallableSignature(proto, nameResolver, kind); if (signature == null) return null; KotlinJvmBinaryClass kotlinClass = findClassWithAnnotationsAndInitializers(container, proto, nameResolver, kind); diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/MemberDeserializer.kt b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/MemberDeserializer.kt index 8eb1adc32b0..48a178a5c5a 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/MemberDeserializer.kt +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/MemberDeserializer.kt @@ -113,7 +113,7 @@ public class MemberDeserializer(private val c: DeserializationContext) { if (Flags.HAS_CONSTANT.get(flags)) { property.setCompileTimeInitializer( c.storageManager.createNullableLazyValue { - val container = c.containingDeclaration.asClassOrPackage() + val container = c.containingDeclaration.asProtoContainer() c.components.constantLoader.loadPropertyConstant(container, proto, c.nameResolver, AnnotatedCallableKind.PROPERTY) } ) @@ -166,13 +166,13 @@ public class MemberDeserializer(private val c: DeserializationContext) { } return DeserializedAnnotations(c.storageManager) { c.components.annotationLoader.loadCallableAnnotations( - c.containingDeclaration.asClassOrPackage(), proto, c.nameResolver, kind + c.containingDeclaration.asProtoContainer(), proto, c.nameResolver, kind ) } } private fun valueParameters(callable: Callable, kind: AnnotatedCallableKind): List { - val containerOfCallable = c.containingDeclaration.getContainingDeclaration().asClassOrPackage() + val containerOfCallable = c.containingDeclaration.getContainingDeclaration().asProtoContainer() return callable.getValueParameterList().withIndices().map { val (i, proto) = it ValueParameterDescriptorImpl( @@ -188,7 +188,7 @@ public class MemberDeserializer(private val c: DeserializationContext) { } private fun getParameterAnnotations( - classOrPackage: ClassOrPackageFragmentDescriptor, + container: ProtoContainer, callable: Callable, kind: AnnotatedCallableKind, valueParameter: Callable.ValueParameter @@ -197,11 +197,13 @@ public class MemberDeserializer(private val c: DeserializationContext) { return Annotations.EMPTY } return DeserializedAnnotations(c.storageManager) { - c.components.annotationLoader.loadValueParameterAnnotations(classOrPackage, callable, c.nameResolver, kind, valueParameter) + c.components.annotationLoader.loadValueParameterAnnotations(container, callable, c.nameResolver, kind, valueParameter) } } - private fun DeclarationDescriptor.asClassOrPackage(): ClassOrPackageFragmentDescriptor = - this as? ClassOrPackageFragmentDescriptor - ?: error("Only members in classes or package fragments should be serialized: $this") + private fun DeclarationDescriptor.asProtoContainer(): ProtoContainer = when(this) { + is PackageFragmentDescriptor -> ProtoContainer(null, fqName) + is DeserializedClassDescriptor -> ProtoContainer(classProto, null) + else -> error("Only members in classes or package fragments should be serialized: $this") + } } diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/AnnotationLoader.java b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/AnnotationLoader.java index 5471633c9ad..4b6dca8dd20 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/AnnotationLoader.java +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/AnnotationLoader.java @@ -19,8 +19,6 @@ package org.jetbrains.jet.descriptors.serialization.descriptors; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.descriptors.serialization.NameResolver; import org.jetbrains.jet.descriptors.serialization.ProtoBuf; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.ClassOrPackageFragmentDescriptor; import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import java.util.List; @@ -30,7 +28,6 @@ public interface AnnotationLoader { @NotNull @Override public List loadClassAnnotations( - @NotNull ClassDescriptor descriptor, @NotNull ProtoBuf.Class classProto, @NotNull NameResolver nameResolver ) { @@ -40,7 +37,7 @@ public interface AnnotationLoader { @NotNull @Override public List loadCallableAnnotations( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable proto, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind @@ -51,7 +48,7 @@ public interface AnnotationLoader { @NotNull @Override public List loadValueParameterAnnotations( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable callable, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind, @@ -68,14 +65,13 @@ public interface AnnotationLoader { @NotNull List loadClassAnnotations( - @NotNull ClassDescriptor descriptor, @NotNull ProtoBuf.Class classProto, @NotNull NameResolver nameResolver ); @NotNull List loadCallableAnnotations( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable proto, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind @@ -83,7 +79,7 @@ public interface AnnotationLoader { @NotNull List loadValueParameterAnnotations( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable callable, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind, diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/ConstantLoader.java b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/ConstantLoader.java index 02d8f84baec..a63ad0b686d 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/ConstantLoader.java +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/ConstantLoader.java @@ -20,7 +20,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.descriptors.serialization.NameResolver; import org.jetbrains.jet.descriptors.serialization.ProtoBuf; -import org.jetbrains.jet.lang.descriptors.ClassOrPackageFragmentDescriptor; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; public interface ConstantLoader { @@ -28,7 +27,7 @@ public interface ConstantLoader { @Nullable @Override public CompileTimeConstant loadPropertyConstant( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable proto, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind @@ -39,7 +38,7 @@ public interface ConstantLoader { @Nullable CompileTimeConstant loadPropertyConstant( - @NotNull ClassOrPackageFragmentDescriptor container, + @NotNull ProtoContainer container, @NotNull ProtoBuf.Callable proto, @NotNull NameResolver nameResolver, @NotNull AnnotatedCallableKind kind diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedClassDescriptor.kt b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedClassDescriptor.kt index 0fc3b0c82b6..f080d23308d 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedClassDescriptor.kt +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedClassDescriptor.kt @@ -40,7 +40,7 @@ import org.jetbrains.jet.descriptors.serialization.NameResolver public class DeserializedClassDescriptor( outerContext: DeserializationContext, - private val classProto: ProtoBuf.Class, + val classProto: ProtoBuf.Class, nameResolver: NameResolver ) : ClassDescriptor, AbstractClassDescriptor( outerContext.storageManager, @@ -70,7 +70,7 @@ public class DeserializedClassDescriptor( Annotations.EMPTY } else DeserializedAnnotations(c.storageManager) { - c.components.annotationLoader.loadClassAnnotations(this, classProto, c.nameResolver) + c.components.annotationLoader.loadClassAnnotations(classProto, c.nameResolver) } override fun getContainingDeclaration(): DeclarationDescriptor = containingDeclaration diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/ProtoContainer.kt b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/ProtoContainer.kt new file mode 100644 index 00000000000..3da1f849e8b --- /dev/null +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/ProtoContainer.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2010-2014 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.jet.descriptors.serialization.descriptors + +import org.jetbrains.jet.lang.resolve.name.FqName +import org.jetbrains.jet.descriptors.serialization.ProtoBuf + +public data class ProtoContainer(val classProto: ProtoBuf.Class?, val packageFqName: FqName?) { + { + assert(classProto != null || packageFqName != null) + } +} \ No newline at end of file