[ObjCExport] Initial implementation of function type translation

^KT-65167
This commit is contained in:
Sebastian Sellmair
2024-01-24 16:17:09 +01:00
committed by Space Team
parent 3766a5f2ad
commit c958aef679
3 changed files with 36 additions and 6 deletions
@@ -69,6 +69,29 @@ class ObjCExportTypeTranslationTest(
assertEquals("A *, B * _Nullable -> C * _Nullable", header.renderTypesOfSymbol("foo"))
}
@Test
fun `test - Unit as return type`() {
val header = header(
"""
fun foo() = Unit
""".trimIndent()
)
assertEquals(" -> void", header.renderTypesOfSymbol("foo"))
}
@Test
fun `test - Unit as parameter type`() {
val header = header(
"""
fun foo(unit: Unit) = Unit
""".trimIndent()
)
assertEquals("Unit * -> void", header.renderTypesOfSymbol("foo"))
}
@Test
fun `test - hiddenTypes - Any - are exposed as id`() {
val header = header("""fun foo(): Any""")