Join Slack
Powered by
Are there any compiler flags I can check to influe...
# getting-started
d
DamianReeves
01/07/2025, 2:13 PM
Are there any compiler flags I can check to influence the Kotlin compiler to generate Java’s
sealed
for Kotlin’s `sealed`… when I decompile the code it doesn’t seem like that is what is happening by default?
r
rocketraman
01/07/2025, 2:34 PM
I doubt it will work, but you could try setting the JVM target to 17 (
https://kotlinlang.org/docs/compiler-reference.html#jvm-target-version
).
gratitude thank you
1
e
ephemient
01/07/2025, 3:17 PM
why doubt? that's exactly how it works.
https://github.com/JetBrains/kotlin/blob/146f0f4904cdd52bf173959aad4889845d4d1b96/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt#L137
gratitude thank you
1
👍 1
d
DamianReeves
01/07/2025, 3:34 PM
Oh this is awesome… this is how I hope it worked but I didn’t know which flag or where to check so really appreciate both answers
2
Views
Open in Slack
Previous
Next