Is there a migration guide for Kotlin Compiler plu...
# compiler
d
Is there a migration guide for Kotlin Compiler plugins? My existing plugin no longer works since upgrading to K2 Kotlin 2.0.0 In particular the first error I am getting (at runtime) is that a class cannot be found using the IrPluginContext.referenceClass( classId ) method. works for kotlin < 2.0.0 ..... not working in kotlin 2.0.0 (I guess because of K2 compiler)
x
Have you followed the steps in here?
d
unsure how that is useful? did you send the correct link That link is about 'compose' ?? not compiler plugin migration!
x
Sorry, you're right. Got that wrong
d
anyone ?
d
There are no guides IMO the best thing you should use to understand, what happens in the compiler is the debugger
For this particular problem with
referenceClass
I have two guesses 1. Dependencies are set incorrectly 2.
ClassId
is built incorrectly (it differs just from FQN for nested classes)
d
thanks
doesn't solve my issue, but thanks for the reply anyhow 😉
Ah ha. You did solve my issue...I just didn't understand point (2) until I read the javadoc for ClassId.fromString(). Something must have changed there. I was using an FQN ('.' separated) to create my ClassId. Now we need to use '/' instead - see its javadoc. Many thanks
👍 1