File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
libraries/tools/abi-validation/src Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -127,11 +127,11 @@ private fun FieldNode.buildFieldSignature(
127127 foundAnnotations.addAll(companionClass?.visibleAnnotations.orEmpty())
128128 foundAnnotations.addAll(companionClass?.invisibleAnnotations.orEmpty())
129129 } else if (isStatic(access) && isFinal(access)) {
130- companionClass = ownerClass.companionName(ownerClass.kotlinMetadata)?.let {
130+ val companionClassCandidate = ownerClass.companionName(ownerClass.kotlinMetadata)?.let {
131131 classes[it]
132132 }
133133
134- val property = companionClass ?.kmProperty(name)
134+ val property = companionClassCandidate ?.kmProperty(name)
135135
136136 if (property != null && JvmFlag .Property .IS_MOVED_FROM_INTERFACE_COMPANION (property.flags)) {
137137 /*
@@ -140,7 +140,11 @@ private fun FieldNode.buildFieldSignature(
140140 *
141141 * See https://github.com/Kotlin/binary-compatibility-validator/issues/90
142142 */
143- foundAnnotations.addAll(companionClass!! .methods.annotationsFor(property.syntheticMethodForAnnotations))
143+ foundAnnotations.addAll(
144+ companionClassCandidate.methods.annotationsFor(
145+ property.syntheticMethodForAnnotations
146+ )
147+ )
144148 }
145149 }
146150
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2016-2024 JetBrains s.r.o.
3+ * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
4+ */
5+
6+ package cases.enums
7+
8+ public enum class EnumWithInternalCompanion {
9+ A , B ;
10+
11+ internal companion object
12+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ public final class cases/enums/EnumClass : java/lang/Enum {
1111 public static fun values ()[Lcases/enums/EnumClass;
1212}
1313
14+ public final class cases/enums/EnumWithInternalCompanion : java/lang/Enum {
15+ public static final field A Lcases/enums/EnumWithInternalCompanion;
16+ public static final field B Lcases/enums/EnumWithInternalCompanion;
17+ public static fun getEntries ()Lkotlin/enums/EnumEntries;
18+ public static fun valueOf (Ljava/lang/String;)Lcases/enums/EnumWithInternalCompanion;
19+ public static fun values ()[Lcases/enums/EnumWithInternalCompanion;
20+ }
21+
1422public final class cases/enums/JavaEnum : java/lang/Enum {
1523 public static final field JA Lcases/enums/JavaEnum;
1624 public static final field JB Lcases/enums/JavaEnum;
You can’t perform that action at this time.
0 commit comments