I'm looking at making a PR for sealedSubclasses. I...
# ksp
z
I'm looking at making a PR for sealedSubclasses. It looks fairly simple, the only hard part is making sure it works with incremental. I can kind of eyeball how other APIs support it, but I'd be curious if there's any docs/guidelines for it. I could also start with a PR of what I have and continue in there if that's easier, let me know
t
Before Kotlin 1.5, it doesn't affect incremental processing. With the new behavior, where subclasses can be anywhere in the same compilation unit or package, we need to resolve the type references from the sealed subclasses to the their super sealed classes. Doing the resolution will leave a trace that contributes to the required dependencies for dirty set calculation. The problem is, how to do this efficiently.
Yeah, please feel free to start a pr. In short, when resolving a type reference, the compiler adds necessary information for incremental
👍 1
z
compilation unit or package
I thought it was just compilation unit?
e
Sealed classes must be in the the same compilation unit and package, meaning the only difference now is that subclasses can be declared in separate files
z
ah found the doc, thanks
👍 1
@Ting-Yuan Huang should I not log anything for incrementalism right now and wait until 1.5? Or should I do it preemptively?
I'll start without incrementalism in any case and go from there on the PR
t
The new sealed class behavior is available in 1.4.30 with some flag. But yeah, starting with that sounds good to me.
👍 1
z
struggling a bit as I'm on an EAP version of intelliJ that doesn't seem happy with KSP's project 😅
t
Thanks! This looks like to me that it may work with incremental processing out of box. Please allow me to do some experiments and test it a little bit before merging.
👍 1