diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/MutableClassDescriptor.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/MutableClassDescriptor.java index 21544203d29..ae8d8158c65 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/MutableClassDescriptor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/MutableClassDescriptor.java @@ -20,8 +20,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.annotations.Annotations; -import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorBase; import org.jetbrains.kotlin.descriptors.impl.ClassConstructorDescriptorImpl; +import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorBase; import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl; import org.jetbrains.kotlin.name.Name; import org.jetbrains.kotlin.resolve.scopes.MemberScope; @@ -151,9 +151,7 @@ public class MutableClassDescriptor extends ClassDescriptorBase implements Class public void createTypeConstructor() { assert typeConstructor == null : typeConstructor; - this.typeConstructor = new ClassTypeConstructorImpl( - this, Annotations.Companion.getEMPTY(), ModalityKt.isFinalClass(this), typeParameters, supertypes - ); + this.typeConstructor = new ClassTypeConstructorImpl(this, ModalityKt.isFinalClass(this), typeParameters, supertypes); for (FunctionDescriptor functionDescriptor : getConstructors()) { ((ClassConstructorDescriptorImpl) functionDescriptor).setReturnType(getDefaultType()); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java index 7c135bc655e..eeb709506d0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java @@ -656,12 +656,6 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes return LazyClassDescriptor.this; } - @NotNull - @Override - public Annotations getAnnotations() { - return Annotations.Companion.getEMPTY(); // TODO - } - @Override public String toString() { return LazyClassDescriptor.this.getName().toString(); diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/KnownDescriptors.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/KnownDescriptors.kt index a8b2807105c..79b8ebae4b4 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/KnownDescriptors.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/KnownDescriptors.kt @@ -51,7 +51,7 @@ open class KnownClassDescriptor( fun initialize(declaredTypeParameters: List, supertypes: List) { this.declaredTypeParameters = declaredTypeParameters this.supertypes = supertypes - this.typeConstructor = ClassTypeConstructorImpl(this, annotations, true, declaredTypeParameters, supertypes) + this.typeConstructor = ClassTypeConstructorImpl(this, true, declaredTypeParameters, supertypes) this.defaultType = TypeUtils.makeUnsubstitutedType(this, unsubstitutedMemberScope) } diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassDescriptor.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassDescriptor.kt index c5587f31fe2..1ff9f5ac5fc 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassDescriptor.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassDescriptor.kt @@ -216,8 +216,6 @@ class LazyJavaClassDescriptor( override val supertypeLoopChecker: SupertypeLoopChecker get() = c.components.supertypeLoopChecker - override val annotations: Annotations get() = Annotations.EMPTY - override fun isFinal(): Boolean = isFinalClass override fun isDenotable() = true diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt index 1ba35282c7a..1bac28c1695 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt @@ -143,7 +143,6 @@ class FunctionClassDescriptor( override fun getDeclarationDescriptor() = this@FunctionClassDescriptor override fun isDenotable() = true override fun isFinal() = false - override val annotations: Annotations get() = Annotations.EMPTY override fun toString() = declarationDescriptor.toString() diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/AbstractTypeAliasDescriptor.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/AbstractTypeAliasDescriptor.kt index b91460994af..2077cab9937 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/AbstractTypeAliasDescriptor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/AbstractTypeAliasDescriptor.kt @@ -88,10 +88,6 @@ abstract class AbstractTypeAliasDescriptor( override fun getBuiltIns(): KotlinBuiltIns = declarationDescriptor.builtIns - override val annotations: Annotations - get() = declarationDescriptor.annotations - override fun toString(): String = "[typealias ${declarationDescriptor.name.asString()}]" } - } diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/AbstractTypeParameterDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/AbstractTypeParameterDescriptor.java index d1e6c8b11ca..56ee977e837 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/AbstractTypeParameterDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/AbstractTypeParameterDescriptor.java @@ -183,12 +183,6 @@ public abstract class AbstractTypeParameterDescriptor extends DeclarationDescrip return AbstractTypeParameterDescriptor.this; } - @NotNull - @Override - public Annotations getAnnotations() { - return AbstractTypeParameterDescriptor.this.getAnnotations(); - } - @NotNull @Override public KotlinBuiltIns getBuiltIns() { diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java index 0657d954921..97a2e15529e 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java @@ -53,9 +53,7 @@ public class ClassDescriptorImpl extends ClassDescriptorBase { this.modality = modality; this.kind = kind; - this.typeConstructor = new ClassTypeConstructorImpl( - this, Annotations.Companion.getEMPTY(), false, Collections.emptyList(), supertypes - ); + this.typeConstructor = new ClassTypeConstructorImpl(this, false, Collections.emptyList(), supertypes); } public final void initialize( diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java index 6ea5067265d..f91e4e1f85b 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java @@ -80,7 +80,7 @@ public class EnumEntrySyntheticClassDescriptor extends ClassDescriptorBase { this.annotations = annotations; this.typeConstructor = new ClassTypeConstructorImpl( - this, getAnnotations(), true, Collections.emptyList(), Collections.singleton(supertype) + this, true, Collections.emptyList(), Collections.singleton(supertype) ); this.scope = new EnumEntryScope(storageManager); diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java index 4b54cffd382..5fc99c2410a 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java @@ -84,9 +84,7 @@ public class LazySubstitutingClassDescriptor implements ClassDescriptor { supertypes.add(substitutor.substitute(supertype, Variance.INVARIANT)); } - typeConstructor = new ClassTypeConstructorImpl( - this, originalTypeConstructor.getAnnotations(), originalTypeConstructor.isFinal(), typeConstructorParameters, supertypes - ); + typeConstructor = new ClassTypeConstructorImpl(this, originalTypeConstructor.isFinal(), typeConstructorParameters, supertypes); } return typeConstructor; diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/calls/inference/CapturedTypeConstructor.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/calls/inference/CapturedTypeConstructor.kt index 2eccd312cd8..d9583924c78 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/calls/inference/CapturedTypeConstructor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/calls/inference/CapturedTypeConstructor.kt @@ -54,8 +54,6 @@ class CapturedTypeConstructor( override fun getDeclarationDescriptor() = null - override val annotations: Annotations get() = Annotations.EMPTY - override fun toString() = "CapturedTypeConstructor($typeProjection)" override fun getBuiltIns(): KotlinBuiltIns = typeProjection.type.constructor.builtIns diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/IntegerValueTypeConstructor.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/IntegerValueTypeConstructor.kt index adc87667547..c1d268f169d 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/IntegerValueTypeConstructor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/IntegerValueTypeConstructor.kt @@ -18,7 +18,6 @@ package org.jetbrains.kotlin.resolve.constants import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor -import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeConstructor import java.util.* @@ -55,13 +54,11 @@ class IntegerValueTypeConstructor( override fun getDeclarationDescriptor() = null - override val annotations: Annotations get() = Annotations.EMPTY - fun getValue(): Long = value override fun getBuiltIns(): KotlinBuiltIns { return builtIns } - override fun toString() = "IntegerValueType(" + value + ")" + override fun toString() = "IntegerValueType($value)" } diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/ClassTypeConstructorImpl.java b/core/descriptors/src/org/jetbrains/kotlin/types/ClassTypeConstructorImpl.java index 117d1af88ad..c61a937c0e6 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/ClassTypeConstructorImpl.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/ClassTypeConstructorImpl.java @@ -20,7 +20,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.descriptors.ClassDescriptor; import org.jetbrains.kotlin.descriptors.SupertypeLoopChecker; import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor; -import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.storage.LockBasedStorageManager; @@ -31,21 +30,18 @@ import java.util.List; public class ClassTypeConstructorImpl extends AbstractClassTypeConstructor implements TypeConstructor { private final ClassDescriptor classDescriptor; - private final Annotations annotations; private final List parameters; private final Collection supertypes; private final boolean isFinal; public ClassTypeConstructorImpl( @NotNull ClassDescriptor classDescriptor, - @NotNull Annotations annotations, boolean isFinal, @NotNull List parameters, @NotNull Collection supertypes ) { super(LockBasedStorageManager.NO_LOCKS); this.classDescriptor = classDescriptor; - this.annotations = annotations; this.isFinal = isFinal; this.parameters = Collections.unmodifiableList(new ArrayList(parameters)); this.supertypes = Collections.unmodifiableCollection(supertypes); @@ -89,10 +85,4 @@ public class ClassTypeConstructorImpl extends AbstractClassTypeConstructor imple protected SupertypeLoopChecker getSupertypeLoopChecker() { return SupertypeLoopChecker.EMPTY.INSTANCE; } - - @NotNull - @Override - public Annotations getAnnotations() { - return annotations; - } } diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/ErrorUtils.java b/core/descriptors/src/org/jetbrains/kotlin/types/ErrorUtils.java index f7c1a6a3aed..bc6cc0a6692 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/ErrorUtils.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/ErrorUtils.java @@ -460,12 +460,6 @@ public class ErrorUtils { return DefaultBuiltIns.getInstance(); } - @NotNull - @Override - public Annotations getAnnotations() { - return Annotations.Companion.getEMPTY(); - } - @Override public String toString() { return debugName; @@ -631,12 +625,6 @@ public class ErrorUtils { return errorTypeConstructor.getDeclarationDescriptor(); } - @NotNull - @Override - public Annotations getAnnotations() { - return errorTypeConstructor.getAnnotations(); - } - @NotNull @Override public KotlinBuiltIns getBuiltIns() { diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/FunctionPlaceholders.kt b/core/descriptors/src/org/jetbrains/kotlin/types/FunctionPlaceholders.kt index aee6d91fb56..b248787e467 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/FunctionPlaceholders.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/FunctionPlaceholders.kt @@ -19,7 +19,6 @@ package org.jetbrains.kotlin.types import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.descriptors.ClassifierDescriptor import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor -import org.jetbrains.kotlin.descriptors.annotations.Annotations class FunctionPlaceholders(private val builtIns: KotlinBuiltIns) { fun createFunctionPlaceholderType( @@ -65,10 +64,6 @@ class FunctionPlaceholderTypeConstructor( return errorTypeConstructor.declarationDescriptor } - override val annotations: Annotations get(): Annotations { - return errorTypeConstructor.annotations - } - override fun toString(): String { return errorTypeConstructor.toString() } diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/IntersectionTypeConstructor.java b/core/descriptors/src/org/jetbrains/kotlin/types/IntersectionTypeConstructor.java index 92d0aa539c9..a4d6887ea76 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/IntersectionTypeConstructor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/IntersectionTypeConstructor.java @@ -20,8 +20,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.builtins.KotlinBuiltIns; import org.jetbrains.kotlin.descriptors.ClassifierDescriptor; import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor; -import org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl; -import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.resolve.scopes.MemberScope; import org.jetbrains.kotlin.resolve.scopes.TypeIntersectionScope; @@ -110,10 +108,4 @@ public class IntersectionTypeConstructor implements TypeConstructor { public int hashCode() { return hashCode; } - - @NotNull - @Override - public Annotations getAnnotations() { - return Annotations.Companion.getEMPTY(); - } } diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeConstructor.java b/core/descriptors/src/org/jetbrains/kotlin/types/TypeConstructor.java index b27186c5b1b..3728fea5815 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeConstructor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeConstructor.java @@ -22,12 +22,11 @@ import org.jetbrains.annotations.ReadOnly; import org.jetbrains.kotlin.builtins.KotlinBuiltIns; import org.jetbrains.kotlin.descriptors.ClassifierDescriptor; import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor; -import org.jetbrains.kotlin.descriptors.annotations.Annotated; import java.util.Collection; import java.util.List; -public interface TypeConstructor extends Annotated { +public interface TypeConstructor { /** * It may differ from ClassDescriptor.declaredParameters if the class is inner, in such case * it also contains additional parameters from outer declarations. diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/checker/NewCapturedType.kt b/core/descriptors/src/org/jetbrains/kotlin/types/checker/NewCapturedType.kt index 604ea5d9203..be7fa79e487 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/checker/NewCapturedType.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/checker/NewCapturedType.kt @@ -116,8 +116,6 @@ class NewCapturedTypeConstructor(val projection: TypeProjection, private var sup override fun isDenotable() = false override fun getDeclarationDescriptor(): ClassifierDescriptor? = null override fun getBuiltIns(): KotlinBuiltIns = projection.type.builtIns - override val annotations: Annotations get() = Annotations.EMPTY override fun toString() = "CapturedType($projection)" - -} \ No newline at end of file +} diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/NotFoundClasses.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/NotFoundClasses.kt index ac663161c18..8025a05c5b4 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/NotFoundClasses.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/NotFoundClasses.kt @@ -89,9 +89,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo ) : ClassDescriptorBase(storageManager, container, name, SourceElement.NO_SOURCE) { private val typeParameters = createTypeParameters(this, numberOfDeclaredTypeParameters) - private val typeConstructor = ClassTypeConstructorImpl( - this, Annotations.EMPTY, /* isFinal = */ true, typeParameters, setOf(module.builtIns.anyType) - ) + private val typeConstructor = ClassTypeConstructorImpl(this, /* isFinal = */ true, typeParameters, setOf(module.builtIns.anyType)) override fun getKind() = ClassKind.CLASS override fun getModality() = Modality.FINAL diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedClassDescriptor.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedClassDescriptor.kt index 8b99075c07b..866d0def049 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedClassDescriptor.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedClassDescriptor.kt @@ -176,8 +176,6 @@ class DeserializedClassDescriptor( override fun getDeclarationDescriptor() = this@DeserializedClassDescriptor - override val annotations: Annotations get() = Annotations.EMPTY // TODO - override fun toString() = name.toString() override val supertypeLoopChecker: SupertypeLoopChecker