Skip to content

Commit a21c6d3

Browse files
lunakolySpace Team
authored andcommitted
[Commonizer] Don't account for isValue when setting hasAnnotations
...of the metadata... built from the commonized Cir. With `FirElementSerializer`, the flag is only set if there are actually some annotations, so we must leave the metadata in the same state as they had when we accepted it as the input. Without this change, some test fail complaining that the commonization result contains unexpected `true` values for `hasAnnotation` when compared to the golden files. See: `ClassifierCommonizationFromSourcesTest#testClassKindAndModifiers`.
1 parent ecbb4cc commit a21c6d3

File tree

1 file changed

+1
-3
lines changed
  • native/commonizer/src/org/jetbrains/kotlin/commonizer/metadata

1 file changed

+1
-3
lines changed

native/commonizer/src/org/jetbrains/kotlin/commonizer/metadata/flags.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,8 @@ internal fun KmTypeAlias.modifiersFrom(ct: CirTypeAlias) {
9494
private inline val CirHasAnnotations.hasAnnotations: Boolean
9595
get() = annotations.isNotEmpty()
9696

97-
// Since 1.4.30 a special @JvmInline annotation is generated to distinguish JVM-inline from value classes.
98-
// This has an effect on class serialization: Every class with isValue == true automatically gets HAS_ANNOTATIONS flag.
9997
private inline val CirClass.hasAnnotations: Boolean
100-
get() = annotations.isNotEmpty() || isValue
98+
get() = annotations.isNotEmpty()
10199

102100
private inline val CirProperty.hasAnnotations: Boolean
103101
get() = annotations.isNotEmpty() || backingFieldAnnotations.isNotEmpty() || delegateFieldAnnotations.isNotEmpty()

0 commit comments

Comments
 (0)