Fix a compatibility issue with AnnotationDescriptor

The `getSourceForArgument` method should be in the interface,
but adding it is a breaking change for Java usages,
since the module is not built with -Xjvm-default (KT-54749).

Move the method to an extension. This doesn't change the behavior,
since it was only ever called on LazyAnnotationDescriptor.
This commit is contained in:
Sergej Jaskiewicz
2022-11-01 17:42:31 +01:00
committed by Space Team
parent af8b9e6700
commit 37b32907ab
5 changed files with 6 additions and 8 deletions
@@ -37,7 +37,6 @@ interface AnnotationDescriptor : AnnotationMarker {
val source: SourceElement
fun getSourceForArgument(name: Name): SourceElement = SourceElement.NO_SOURCE
}
val AnnotationDescriptor.abbreviationFqName: FqName?
@@ -67,12 +67,6 @@ public class AnnotationDescriptorImpl implements AnnotationDescriptor {
return source;
}
@NotNull
@Override
public SourceElement getSourceForArgument(@NotNull Name name) {
return SourceElement.NO_SOURCE;
}
@Override
public String toString() {
return DescriptorRenderer.FQ_NAMES_IN_TYPES.renderAnnotation(this, null);