fc87043cb3
Add PropertyDescriptor.backingField/delegateField to store annotations on the field directly in an otherwise almost empty descriptor instance, instead of storing them with use-sites in the corresponding property descriptor. Instead of AnnotationWithTarget, create AnnotationDescriptor instances in AnnotationSplitter. Change DescriptorRenderer to render annotations on "related" declarations when needed, with the explicit use-site target if applicable. Most changes in diagnostic test data are related to the fact that annotations which are known to have an incompatible use-site to the declaration they're applied at (such as `@param:`-annotation on a function), are now not loaded at all. It's fine because the code is erroneous, so it doesn't really matter how do we load annotations with invalid targets (some of this logic is also changed freely in subsequent commits). Some changes are also explained by the fact that for example an annotation on the property which is only applicable to FIELD is now rendered with an explicit use-site target `@field:`, regardless of whether it did have that use-site target syntactically or not. Basically, after this change there's no point in calling Annotations.getUseSiteTargetedAnnotations/getAllAnnotations anymore because it's easier and more intuitive to just use Annotations of the corresponding descriptor -- the backing / delegate field (introduced in this commit) or the extension receiver / setter parameter (related behavior was fixed in previous commits). Usages of use-site-target-related methods will be refactored out in subsequent commits
59 lines
3.0 KiB
Plaintext
Vendored
59 lines
3.0 KiB
Plaintext
Vendored
package
|
|
|
|
@field:Field public val x: kotlin.Int = 42
|
|
@Field public val y: kotlin.Int
|
|
|
|
@Field public final annotation class Another : kotlin.Annotation {
|
|
public constructor Another()
|
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
}
|
|
|
|
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FIELD}) public final annotation class Field : kotlin.Annotation {
|
|
public constructor Field()
|
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
}
|
|
|
|
public interface His {
|
|
@Field public abstract val x: kotlin.Int
|
|
@Field public open val y: kotlin.Int
|
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
}
|
|
|
|
@Field public abstract class My {
|
|
public constructor My(/*0*/ @Field arg: kotlin.Int, /*1*/ w: kotlin.Int)
|
|
@Field public final val v: kotlin.Int
|
|
@field:Field public final val w: kotlin.Int
|
|
@field:Field public final val x: kotlin.Int
|
|
@Field public final val y: kotlin.Int
|
|
@Field public abstract val z: kotlin.Int
|
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
@Field public final fun foo(): kotlin.Unit
|
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
}
|
|
|
|
public final enum class Your : kotlin.Enum<Your> {
|
|
@Field enum entry FIRST
|
|
|
|
private constructor Your()
|
|
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
|
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
|
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
|
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: Your): kotlin.Int
|
|
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
|
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<Your!>!
|
|
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
|
|
// Static members
|
|
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): Your
|
|
public final /*synthesized*/ fun values(): kotlin.Array<Your>
|
|
}
|