Minor, drop handling of deprecated kotlin.Extension annotation
This commit is contained in:
@@ -204,9 +204,6 @@ public abstract class KotlinBuiltIns {
|
|||||||
public final FqNameUnsafe kCallable = reflect("KCallable");
|
public final FqNameUnsafe kCallable = reflect("KCallable");
|
||||||
public final ClassId kProperty = ClassId.topLevel(reflect("KProperty").toSafe());
|
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> fqNameToPrimitiveType;
|
||||||
public final Map<FqNameUnsafe, PrimitiveType> arrayClassFqNameToPrimitiveType;
|
public final Map<FqNameUnsafe, PrimitiveType> arrayClassFqNameToPrimitiveType;
|
||||||
{
|
{
|
||||||
@@ -813,14 +810,13 @@ public abstract class KotlinBuiltIns {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public AnnotationDescriptor createExtensionAnnotation() {
|
private AnnotationDescriptor createExtensionFunctionTypeAnnotation() {
|
||||||
return new AnnotationDescriptorImpl(getBuiltInClassByName(FQ_NAMES.extensionFunctionType.shortName()).getDefaultType(),
|
return new AnnotationDescriptorImpl(getBuiltInClassByName(FQ_NAMES.extensionFunctionType.shortName()).getDefaultType(),
|
||||||
Collections.<ValueParameterDescriptor, ConstantValue<?>>emptyMap(), SourceElement.NO_SOURCE);
|
Collections.<ValueParameterDescriptor, ConstantValue<?>>emptyMap(), SourceElement.NO_SOURCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isTypeAnnotatedWithExtension(@NotNull KotlinType type) {
|
private static boolean isTypeAnnotatedWithExtension(@NotNull KotlinType type) {
|
||||||
return type.getAnnotations().findAnnotation(FQ_NAMES.extensionFunctionType) != null ||
|
return type.getAnnotations().findAnnotation(FQ_NAMES.extensionFunctionType) != null;
|
||||||
type.getAnnotations().findAnnotation(FQ_NAMES.deprecatedExtensionAnnotation) != null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -844,7 +840,7 @@ public abstract class KotlinBuiltIns {
|
|||||||
if (annotations.findAnnotation(FQ_NAMES.extensionFunctionType) != null) return annotations;
|
if (annotations.findAnnotation(FQ_NAMES.extensionFunctionType) != null) return annotations;
|
||||||
|
|
||||||
// TODO: preserve laziness of given annotations
|
// TODO: preserve laziness of given annotations
|
||||||
return new AnnotationsImpl(plus(annotations, listOf(createExtensionAnnotation())));
|
return new AnnotationsImpl(plus(annotations, listOf(createExtensionFunctionTypeAnnotation())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+1
-2
@@ -81,8 +81,7 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
|
|||||||
&& type.argumentList.none { it.projection == Projection.STAR }
|
&& type.argumentList.none { it.projection == Projection.STAR }
|
||||||
if (shouldBuildAsFunctionType) {
|
if (shouldBuildAsFunctionType) {
|
||||||
val extension = annotations.any { annotation ->
|
val extension = annotations.any { annotation ->
|
||||||
val fqName = annotation.asSingleFqName()
|
annotation.asSingleFqName() == KotlinBuiltIns.FQ_NAMES.extensionFunctionType
|
||||||
fqName == KotlinBuiltIns.FQ_NAMES.extensionFunctionType || fqName == KotlinBuiltIns.FQ_NAMES.deprecatedExtensionAnnotation
|
|
||||||
}
|
}
|
||||||
createFunctionTypeStub(parent, type, extension)
|
createFunctionTypeStub(parent, type, extension)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user