Kapt+JVM_IR: do not run IR plugins in kapt mode

Because in kapt stub generation mode (aka ClassBuilderMode.KAPT3, aka
generateBodies=false in psi2ir), method bodies are not generated and
compiler plugins such as kotlinx-serialization might not expect that.

 #KT-54245 Fixed
This commit is contained in:
Alexander Udalov
2022-12-06 23:46:52 +01:00
committed by Space Team
parent 5848b2fde6
commit a594434a95
4 changed files with 29 additions and 4 deletions
@@ -163,7 +163,7 @@ open class JvmIrCodegenFactory(
SourceDeclarationsPreprocessor(psi2irContext).run(input.files)
if (pluginExtensions.isNotEmpty()) {
if (pluginExtensions.isNotEmpty() && psi2irContext.configuration.generateBodies) {
// The plugin context contains unbound symbols right after construction and has to be
// instantiated before we resolve unbound symbols and invoke any postprocessing steps.
val pluginContext = IrPluginContextImpl(