Fix producing framework with extensions to Any
This commit is contained in:
committed by
SvyatoslavScherbina
parent
9789420ed3
commit
b98afb6c88
+5
-1
@@ -41,7 +41,11 @@ internal class ObjCExportHeaderGenerator(val context: Context) {
|
||||
override fun getCategoryMembersFor(descriptor: ClassDescriptor) =
|
||||
extensions[descriptor].orEmpty()
|
||||
|
||||
override val specialMappedTypes get() = customTypeMappers.keys
|
||||
override fun isSpecialMapped(descriptor: ClassDescriptor): Boolean {
|
||||
// TODO: this method duplicates some of the [mapReferenceType] logic.
|
||||
return descriptor == context.builtIns.any ||
|
||||
descriptor.getAllSuperClassifiers().any { it in customTypeMappers }
|
||||
}
|
||||
}
|
||||
|
||||
val namer = ObjCExportNamer(context, mapper)
|
||||
|
||||
+1
-4
@@ -34,15 +34,12 @@ import org.jetbrains.kotlin.types.typeUtil.isUnit
|
||||
internal interface ObjCExportMapper {
|
||||
fun getCategoryMembersFor(descriptor: ClassDescriptor): List<CallableMemberDescriptor>
|
||||
val maxFunctionTypeParameterCount get() = 22
|
||||
val specialMappedTypes: Set<ClassDescriptor>
|
||||
fun isSpecialMapped(descriptor: ClassDescriptor): Boolean
|
||||
}
|
||||
|
||||
private fun ObjCExportMapper.isRepresentedAsObjCInterface(descriptor: ClassDescriptor): Boolean =
|
||||
!descriptor.isInterface && !isSpecialMapped(descriptor)
|
||||
|
||||
private fun ObjCExportMapper.isSpecialMapped(descriptor: ClassDescriptor): Boolean =
|
||||
descriptor.getAllSuperClassifiers().any { it in specialMappedTypes }
|
||||
|
||||
internal fun ObjCExportMapper.getClassIfCategory(descriptor: CallableMemberDescriptor): ClassDescriptor? {
|
||||
if (descriptor.dispatchReceiverParameter != null) return null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user