mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
Also, fix the value of "hasAnnotations" flag to reflect if there are any _non-source_ annotations on a declaration. Unfortunately, after this change IncrementalJsCompilerRunnerTestGenerated$PureKotlin.testAnnotations starts to fail because of the following problem. The problem is that annotations on property accessors are not serialized yet on JS (see KT-14529), yet property proto message has setterFlags field which has the hasAnnotations flag. Upon the full rebuild of the code in that test, we correctly write hasAnnotations = true, but annotations themselves are not serialized. After an incremental build, we deserialize property setter descriptor, observe its Annotations object which happens to be an instance of NonEmptyDeserializedAnnotationsWithPossibleTargets. Now, because annotations itself are not serialized, that Annotations object has no annotations, yet its isEmpty always returns false (see the code). Everything worked correctly before the change because in DescriptorSerializer.hasAnnotations, we used Annotations.isEmpty and the result was the same in the full rebuild and in the incremental scenario. But now we're actually loading annotations, to determine their retention, and that's why the setterFlags are becoming different here and the test fails #KT-23360 Fixed
27 lines
1.2 KiB
Plaintext
Vendored
27 lines
1.2 KiB
Plaintext
Vendored
package test
|
|
|
|
@test.A public val property: kotlin.Unit
|
|
@test.A public fun </*0*/ @test.A T> function(/*0*/ @test.A param: kotlin.Unit): @test.A kotlin.Unit
|
|
|
|
@kotlin.annotation.Retention(value = AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER}) public final annotation class A : kotlin.Annotation {
|
|
public constructor A()
|
|
}
|
|
|
|
public final enum class Enum : kotlin.Enum<test.Enum> {
|
|
@test.A enum entry ENTRY
|
|
|
|
private constructor Enum()
|
|
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: test.Enum): kotlin.Int
|
|
|
|
// Static members
|
|
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.Enum
|
|
public final /*synthesized*/ fun values(): kotlin.Array<test.Enum>
|
|
}
|
|
|
|
@test.A public final class Klass {
|
|
@test.A public constructor Klass()
|
|
}
|