https://kotlinlang.org logo
j

Justin Tullgren

06/30/2023, 5:44 PM
Hello, I am having trouble casting a kotlin sealed class in a java interop situation. Can anyone help me figure it out?
Sealed Class.kt
Java Call.java
a

asdf asdf

06/30/2023, 5:55 PM
Right now the
C
class is invalid because data classes require at least 1 constructor property
Try removing the
data
modifier and see if the java code compiles
j

Justin Tullgren

06/30/2023, 5:57 PM
ah okay. i'll check. thanks!
still no dice but i found another workaround, just providing a getter with kotlin casting it. works for now.
thanks!