Minor, drop handling of deprecated kotlin.Extension annotation

This commit is contained in:
Alexander Udalov
2016-03-09 14:19:37 +03:00
parent 90a48d3b35
commit 52309cd10e
2 changed files with 4 additions and 9 deletions
@@ -204,9 +204,6 @@ public abstract class KotlinBuiltIns {
public final FqNameUnsafe kCallable = reflect("KCallable");
public final ClassId kProperty = ClassId.topLevel(reflect("KProperty").toSafe());
// TODO: remove in 1.0
public final FqName deprecatedExtensionAnnotation = fqName("Extension");
public final Map<FqNameUnsafe, PrimitiveType> fqNameToPrimitiveType;
public final Map<FqNameUnsafe, PrimitiveType> arrayClassFqNameToPrimitiveType;
{
@@ -813,14 +810,13 @@ public abstract class KotlinBuiltIns {
}
@NotNull
public AnnotationDescriptor createExtensionAnnotation() {
private AnnotationDescriptor createExtensionFunctionTypeAnnotation() {
return new AnnotationDescriptorImpl(getBuiltInClassByName(FQ_NAMES.extensionFunctionType.shortName()).getDefaultType(),
Collections.<ValueParameterDescriptor, ConstantValue<?>>emptyMap(), SourceElement.NO_SOURCE);
}
private static boolean isTypeAnnotatedWithExtension(@NotNull KotlinType type) {
return type.getAnnotations().findAnnotation(FQ_NAMES.extensionFunctionType) != null ||
type.getAnnotations().findAnnotation(FQ_NAMES.deprecatedExtensionAnnotation) != null;
return type.getAnnotations().findAnnotation(FQ_NAMES.extensionFunctionType) != null;
}
@NotNull
@@ -844,7 +840,7 @@ public abstract class KotlinBuiltIns {
if (annotations.findAnnotation(FQ_NAMES.extensionFunctionType) != null) return annotations;
// TODO: preserve laziness of given annotations
return new AnnotationsImpl(plus(annotations, listOf(createExtensionAnnotation())));
return new AnnotationsImpl(plus(annotations, listOf(createExtensionFunctionTypeAnnotation())));
}
@NotNull
@@ -81,8 +81,7 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
&& type.argumentList.none { it.projection == Projection.STAR }
if (shouldBuildAsFunctionType) {
val extension = annotations.any { annotation ->
val fqName = annotation.asSingleFqName()
fqName == KotlinBuiltIns.FQ_NAMES.extensionFunctionType || fqName == KotlinBuiltIns.FQ_NAMES.deprecatedExtensionAnnotation
annotation.asSingleFqName() == KotlinBuiltIns.FQ_NAMES.extensionFunctionType
}
createFunctionTypeStub(parent, type, extension)
return