Is there currently a way to define sealed class in...
# announcements
k
Is there currently a way to define sealed class inheritors in multiple files? They're getting a bit too big for a single file.
s
some folks have recommended some magic combination of annotations including
@JvmMultifileClass
but I’ve never gotten that to work
k
@Ruckus I've read those docs, It's just that I remember hearing something like what @Shawn is saying.
r
Interesting. I don't recall hearing anything like that. I'll have to look into it later when I get a spare moment.
k
Hmm, just putting the standard
Copy code
@file:JvmName("Test")
@file:JvmMultifileClass
in both files doesn't do it.
s
I think it’s a bit of a wild goose chase - nobody who’s ever claimed you can split a sealed class across multiple files has actually presented a working example, at least to my knowledge
b
How big is 'too big'?
k
~200 lines each
It's not terrible, it would just be neater if they were separated into multiple files.