@@ -1146,15 +1146,6 @@ open class KotlinUsesExtractor(
1146
1146
return res
1147
1147
}
1148
1148
1149
- fun <T : DbCallable > useFunctionCommon (f : IrFunction , label : String ): Label <out T > {
1150
- val id: Label <T > = tw.getLabelFor(label)
1151
- if (isExternalDeclaration(f)) {
1152
- extractFunctionLaterIfExternalFileMember(f)
1153
- extractExternalEnclosingClassLater(f)
1154
- }
1155
- return id
1156
- }
1157
-
1158
1149
// These are classes with Java equivalents, but whose methods don't all exist on those Java equivalents--
1159
1150
// for example, the numeric classes define arithmetic functions (Int.plus, Long.or and so on) that lower to
1160
1151
// primitive arithmetic on the JVM, but which we extract as calls to reflect the source syntax more closely.
@@ -1214,15 +1205,20 @@ open class KotlinUsesExtractor(
1214
1205
val ids = getLocallyVisibleFunctionLabels(f)
1215
1206
return ids.function.cast<T >()
1216
1207
} else {
1217
- val realFunction = kotlinFunctionToJavaEquivalent(f, noReplace)
1218
- return useFunctionCommon<T >(realFunction, getFunctionLabel(realFunction, classTypeArgsIncludingOuterClasses))
1208
+ return useFunction(f, null , classTypeArgsIncludingOuterClasses, noReplace)
1219
1209
}
1220
1210
}
1221
1211
1222
- fun <T : DbCallable > useFunction (f : IrFunction , parentId : Label <out DbElement >, classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? , noReplace : Boolean = false) =
1223
- kotlinFunctionToJavaEquivalent(f, noReplace).let {
1224
- useFunctionCommon<T >(it, getFunctionLabel(it, parentId, classTypeArgsIncludingOuterClasses))
1212
+ fun <T : DbCallable > useFunction (f : IrFunction , parentId : Label <out DbElement >? , classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? , noReplace : Boolean = false): Label <out T > {
1213
+ val javaFun = kotlinFunctionToJavaEquivalent(f, noReplace)
1214
+ val label = getFunctionLabel(javaFun, parentId, classTypeArgsIncludingOuterClasses)
1215
+ val id: Label <T > = tw.getLabelFor(label)
1216
+ if (isExternalDeclaration(javaFun)) {
1217
+ extractFunctionLaterIfExternalFileMember(javaFun)
1218
+ extractExternalEnclosingClassLater(javaFun)
1225
1219
}
1220
+ return id
1221
+ }
1226
1222
1227
1223
fun getTypeArgumentLabel (
1228
1224
arg : IrTypeArgument
0 commit comments