[ObjCExport][Minor] Move 'isBinaryRepresentationNullable' utility to bottom of translateToObjCType.kt

^KT-65167
This commit is contained in:
Sebastian Sellmair
2024-01-24 15:52:29 +01:00
committed by Space Team
parent 9f0aa7d30c
commit 3766a5f2ad
@@ -46,21 +46,6 @@ internal fun KtType.translateToObjCType(typeBridge: TypeBridge): ObjCType {
}
}
context(KtAnalysisSession)
private fun KtType.isBinaryRepresentationNullable(): Boolean {
/* Convention to match K1 implementation */
if (this is KtErrorType) return false
if (fullyExpandedType.canBeNull) return true
getInlineTargetTypeOrNull()?.let { inlineTargetType ->
if (inlineTargetType.canBeNull) return true
}
return false
}
/**
* [org.jetbrains.kotlin.backend.konan.objcexport.ObjCExportTranslatorImpl.mapReferenceType]
*/
@@ -179,6 +164,21 @@ private fun ObjCNonNullReferenceType.withNullabilityOf(kotlinType: KtType): ObjC
}
}
context(KtAnalysisSession)
private fun KtType.isBinaryRepresentationNullable(): Boolean {
/* Convention to match K1 implementation */
if (this is KtErrorType) return false
if (fullyExpandedType.canBeNull) return true
getInlineTargetTypeOrNull()?.let { inlineTargetType ->
if (inlineTargetType.canBeNull) return true
}
return false
}
/**
* Types to be "hidden" during mapping, i.e. represented as `id`.
*