@@ -1262,13 +1262,13 @@ open class KotlinFileExtractor(
1262
1262
DeclarationStackAdjuster (f).use {
1263
1263
val fNameSuffix = getExtensionReceiverType(f)?.let { it.classFqName?.asString()?.replace(" ." , " $$" ) } ? : " "
1264
1264
val extractType = if (isAnnotationClassField(f)) kClassToJavaClass(f.type) else f.type
1265
- return extractField(useField(f), " ${f.name.asString()}$fNameSuffix " , extractType, parentId, tw.getLocation(f), f.visibility, f, isExternalDeclaration(f), f.isFinal)
1265
+ return extractField(useField(f), " ${f.name.asString()}$fNameSuffix " , extractType, parentId, tw.getLocation(f), f.visibility, f, isExternalDeclaration(f), f.isFinal, isDirectlyExposedCompanionObjectField(f) )
1266
1266
}
1267
1267
}
1268
1268
}
1269
1269
1270
1270
1271
- private fun extractField (id : Label <out DbField >, name : String , type : IrType , parentId : Label <out DbReftype >, locId : Label <DbLocation >, visibility : DescriptorVisibility , errorElement : IrElement , isExternalDeclaration : Boolean , isFinal : Boolean ): Label <out DbField > {
1271
+ private fun extractField (id : Label <out DbField >, name : String , type : IrType , parentId : Label <out DbReftype >, locId : Label <DbLocation >, visibility : DescriptorVisibility , errorElement : IrElement , isExternalDeclaration : Boolean , isFinal : Boolean , isStatic : Boolean ): Label <out DbField > {
1272
1272
val t = useType(type)
1273
1273
tw.writeFields(id, name, t.javaResult.id, parentId, id)
1274
1274
tw.writeFieldsKotlinType(id, t.kotlinResult.id)
@@ -1278,6 +1278,9 @@ open class KotlinFileExtractor(
1278
1278
if (isFinal) {
1279
1279
addModifiers(id, " final" )
1280
1280
}
1281
+ if (isStatic) {
1282
+ addModifiers(id, " static" )
1283
+ }
1281
1284
1282
1285
if (! isExternalDeclaration) {
1283
1286
val fieldDeclarationId = tw.getFreshIdLabel<DbFielddecl >()
@@ -4209,12 +4212,12 @@ open class KotlinFileExtractor(
4209
4212
val firstAssignmentStmtIdx = 1
4210
4213
4211
4214
if (dispatchReceiverInfo != null ) {
4212
- extractField(dispatchReceiverInfo.field, " <dispatchReceiver>" , dispatchReceiverInfo.type, classId, locId, DescriptorVisibilities .PRIVATE , callableReferenceExpr, isExternalDeclaration = false , isFinal = true )
4215
+ extractField(dispatchReceiverInfo.field, " <dispatchReceiver>" , dispatchReceiverInfo.type, classId, locId, DescriptorVisibilities .PRIVATE , callableReferenceExpr, isExternalDeclaration = false , isFinal = true , isStatic = false )
4213
4216
extractParameterToFieldAssignmentInConstructor(" <dispatchReceiver>" , dispatchReceiverInfo.type, dispatchReceiverInfo.field, 0 + dispatchReceiverInfo.indexOffset, firstAssignmentStmtIdx + dispatchReceiverInfo.indexOffset)
4214
4217
}
4215
4218
4216
4219
if (extensionReceiverInfo != null ) {
4217
- extractField(extensionReceiverInfo.field, " <extensionReceiver>" , extensionReceiverInfo.type, classId, locId, DescriptorVisibilities .PRIVATE , callableReferenceExpr, isExternalDeclaration = false , isFinal = true )
4220
+ extractField(extensionReceiverInfo.field, " <extensionReceiver>" , extensionReceiverInfo.type, classId, locId, DescriptorVisibilities .PRIVATE , callableReferenceExpr, isExternalDeclaration = false , isFinal = true , isStatic = false )
4218
4221
extractParameterToFieldAssignmentInConstructor( " <extensionReceiver>" , extensionReceiverInfo.type, extensionReceiverInfo.field, 0 + extensionReceiverInfo.indexOffset, firstAssignmentStmtIdx + extensionReceiverInfo.indexOffset)
4219
4222
}
4220
4223
}
@@ -5282,7 +5285,7 @@ open class KotlinFileExtractor(
5282
5285
5283
5286
// add field
5284
5287
val fieldId = tw.getFreshIdLabel<DbField >()
5285
- extractField(fieldId, " <fn>" , functionType, classId, locId, DescriptorVisibilities .PRIVATE , e, isExternalDeclaration = false , isFinal = true )
5288
+ extractField(fieldId, " <fn>" , functionType, classId, locId, DescriptorVisibilities .PRIVATE , e, isExternalDeclaration = false , isFinal = true , isStatic = false )
5286
5289
5287
5290
// adjust constructor
5288
5291
helper.extractParameterToFieldAssignmentInConstructor(" <fn>" , functionType, fieldId, 0 , 1 )
0 commit comments