What does `NativeBuildType` do? When setting it to...
# kotlin-native
r
What does
NativeBuildType
do? When setting it to
RELEASE
, it strips the result from at least 2 enums in the code leading to crashes
🤨 1
😱 1
a
r
It looks like the problem comes from
optimized
Whatever buildType I use, setting
optimized = true
leads to the error
kotlin.RuntimeException: Unexpected receiver type: com.mydomain.SomeEnum
a
Oh, there was a problem with that. Can you try to use the EAP2? Something similar was fixed in it.(https://discuss.kotlinlang.org/t/kotlin-1-3-70-early-access-preview/15876/19) If it won’t help, please try to pack a reproducer and share it with us 🙏 That would help a lot.
r
I can’t have a reproducer and I can’t use EAP as it’s a very complex system (I would need updated coroutines, ktor, serialization and others)
I’m importing these enums with aliases, trying without
Nope, not coming from the aliases
I think we found the problematic code, checking
@Artyom Degtyarev [JB] here is an example of problematic code
ApiParticipationStatus
is an alias for the
SomeEnum
in the error message, but removing the alias doesn’t change anything. Making this
of
function return just one value of the
Status
enum removes the error
This alternative works but is not great (we have no guarantee that the values will stay similar)
a
Thanks! If interested, see this issue: https://github.com/JetBrains/kotlin-native/issues/3343 There are some examples of similar problem, slightly different inside. Some of that should be gone in EAP, AFAIK.
r
Thanks, looks like it has nothing to do with enums or serialization then
r
Looks like all the other occurences have something to do with
List
, but not in my case. Or maybe there’s some list in an enum
a
I’m just saying that it seems like a group of problems with similar output rather than a single bug. That’s the reason for pushing the eap use here - we have to check if something left unfixed.
r
I see, but we just can’t use an EAP without all the dependencies being updated and it’s not happening so we’ll have to see after the release of 1.3.70