Grigory Panko
03/20/2025, 11:00 AMSirUnsupportedType
appearing which later cause java.lang.IllegalStateException: Attempt to bridge unbridgeable type: SirUnsupportedType.
? I'm experimenting with Swift export in our project, and trying to export almost any module (trying to at least export dependencies before exporting our own modules) produces this exception. I've succeeded only with exporting single kotlin-stdlib
, while having this exception with, for example, kotlinx-datetime
, ktor-http
, ktor-client-core
or coroutines-core
. Maybe there is some list of supported/unsupported types, or I'm just setting up something wrong?svyatoslav.scherbina
03/21/2025, 1:11 PMSirUnsupportedType
properly. See e.g. https://github.com/JetBrains/kotlin/blob/9b117ee9e6dae8ad5abfc3df91a0644acc1e7492/[…]/kotlin/swiftexport/standalone/builders/buildFunctionBridges.kt.
So, there is no other way than to debug the Swift Export implementation.Grigory Panko
03/24/2025, 10:01 AMpatchCallableBodyAndGenerateRequest
doesn't check extension receiver parameters: while trying to bridge function Instant::offsetIn
typesUsed
contains 2 elements (return type and timeZone parameter), but this function also has receiver parameter which is SirUnsupportedType
, that's the reason of exception. Also, just curious, why is kotlinx.datetime.Instant
unsupported type? We will really need it to export our modules :)svyatoslav.scherbina
03/24/2025, 10:44 AMHi! Seems likeNice catch! This was fixed some time ago, and I can't reproduce this locally. Which version are you on?doesn't check extension receiver parameters: while trying to bridge functionpatchCallableBodyAndGenerateRequest
Instant::offsetIn
contains 2 elements (return type and timeZone parameter), but this function also has receiver parameter which istypesUsed
, that's the reason of exception.SirUnsupportedType
Also, just curious, why isBecause it has a supertypeunsupported type? We will really need it to export our modules :)kotlinx.datetime.Instant
Comparable<Instant>
, which is a generic interface. Neither interfaces nor generics are supported at the moment.Grigory Panko
03/24/2025, 10:56 AMsvyatoslav.scherbina
03/24/2025, 11:00 AMGrigory Panko
03/24/2025, 11:26 AM