File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed 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(
127
127
foundAnnotations.addAll(companionClass?.visibleAnnotations.orEmpty())
128
128
foundAnnotations.addAll(companionClass?.invisibleAnnotations.orEmpty())
129
129
} else if (isStatic(access) && isFinal(access)) {
130
- companionClass = ownerClass.companionName(ownerClass.kotlinMetadata)?.let {
130
+ val companionClassCandidate = ownerClass.companionName(ownerClass.kotlinMetadata)?.let {
131
131
classes[it]
132
132
}
133
133
134
- val property = companionClass ?.kmProperty(name)
134
+ val property = companionClassCandidate ?.kmProperty(name)
135
135
136
136
if (property != null && JvmFlag .Property .IS_MOVED_FROM_INTERFACE_COMPANION (property.flags)) {
137
137
/*
@@ -140,7 +140,11 @@ private fun FieldNode.buildFieldSignature(
140
140
*
141
141
* See https://github.com/Kotlin/binary-compatibility-validator/issues/90
142
142
*/
143
- foundAnnotations.addAll(companionClass!! .methods.annotationsFor(property.syntheticMethodForAnnotations))
143
+ foundAnnotations.addAll(
144
+ companionClassCandidate.methods.annotationsFor(
145
+ property.syntheticMethodForAnnotations
146
+ )
147
+ )
144
148
}
145
149
}
146
150
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 {
11
11
public static fun values ()[Lcases/enums/EnumClass;
12
12
}
13
13
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
+
14
22
public final class cases/enums/JavaEnum : java/lang/Enum {
15
23
public static final field JA Lcases/enums/JavaEnum;
16
24
public static final field JB Lcases/enums/JavaEnum;
You can’t perform that action at this time.
0 commit comments