Compiler internal error at createCapturedIfNeeded() after updating to Kotlin version

It looks like it has something to do with the serialization plugin but I’m not sure. I knew I would have some issues when I did this update since I skipped a few versions but it’s obviously hard for me to find the issues now since the compiler is crashing.

This is where the build fails (the link is buggy sometimes, it’s at line 2157 if the link doesn’t take you there automatically).

I can’t reproduce this error and I couldn’t find any reports of it online, I’ll post it to YouTrack after some feedback here. I’m mostly hoping someone can help me find a workaround while I wait for a fix. I wanted to implement some new features in kotlinx.serialization which needs the latest version of Kotlin.

Yes, looks like a bug in the serialization plugin. Please report an issue to https://github.com/Kotlin/kotlinx.serialization/issues.