@@ -1191,20 +1191,22 @@ open class KotlinUsesExtractor(
1191
1191
else
1192
1192
f.parentClassOrNull?.let { parentClass ->
1193
1193
getJavaEquivalentClass(parentClass)?.let { javaClass ->
1194
- if (javaClass != parentClass)
1194
+ if (javaClass != parentClass) {
1195
+ val jvmName = getSpecialJvmName(f) ? : f.name.asString()
1195
1196
// Look for an exact type match...
1196
1197
javaClass.declarations.findSubType<IrFunction > { decl ->
1197
- decl.name == f.name &&
1198
- decl.valueParameters.size == f.valueParameters.size &&
1199
- // Note matching by classifier not the whole type so that generic arguments are allowed to differ,
1200
- // as they always will for method type parameters occurring in parameter types (e.g. <T> toArray(T[] array)
1201
- // Differing only by nullability would also be insignificant if it came up.
1202
- decl.valueParameters.zip(f.valueParameters).all { p -> p.first.type.classifierOrNull == p.second.type.classifierOrNull }
1198
+ decl.name.asString() == jvmName &&
1199
+ decl.valueParameters.size == f.valueParameters.size &&
1200
+ // Note matching by classifier not the whole type so that generic arguments are allowed to differ,
1201
+ // as they always will for method type parameters occurring in parameter types (e.g. <T> toArray(T[] array)
1202
+ // Differing only by nullability would also be insignificant if it came up.
1203
+ decl.valueParameters.zip(f.valueParameters)
1204
+ .all { p -> p.first.type.classifierOrNull == p.second.type.classifierOrNull }
1203
1205
} ? :
1204
1206
// Or if there is none, look for the only viable overload
1205
1207
javaClass.declarations.singleOrNullSubType<IrFunction > { decl ->
1206
- decl.name == f.name &&
1207
- decl.valueParameters.size == f.valueParameters.size
1208
+ decl.name.asString() == jvmName &&
1209
+ decl.valueParameters.size == f.valueParameters.size
1208
1210
} ? :
1209
1211
// Or check property accessors:
1210
1212
(f.propertyIfAccessor as ? IrProperty )?.let { kotlinProp ->
@@ -1223,6 +1225,7 @@ open class KotlinUsesExtractor(
1223
1225
}
1224
1226
null
1225
1227
}
1228
+ }
1226
1229
else
1227
1230
null
1228
1231
}
0 commit comments