Skip to content

Incompatible with Kotlin 2.4.0: ClassCastException in StructuredCoroutinesCompilerPluginRegistrar (ProjectExtensionDescriptor removed, KT-83341) #59

@kdroidFilter

Description

@kdroidFilter

Summary

The compiler plugin (latest 1.0.0) is incompatible with Kotlin 2.4.0. Any compilation with the plugin applied fails during FIR extension registration.

Stacktrace

java.lang.ClassCastException: class org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter$Companion cannot be cast to class org.jetbrains.kotlin.extensions.ProjectExtensionDescriptor
    at io.github.santimattius.structured.compiler.StructuredCoroutinesCompilerPluginRegistrar.registerExtensions(StructuredCoroutinesCompilerPluginRegistrar.kt:101)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$org_jetbrains_kotlin_cli_base(KotlinCoreEnvironment.kt:758)
    ...

Cause

Kotlin 2.4.0 removed/changed the ProjectExtensionDescriptor-based FIR extension registration mechanism (see KT-83341). FirExtensionRegistrarAdapter.Companion no longer extends ProjectExtensionDescriptor, so the cast in registerExtensions throws.

The published structured-coroutines-compiler:1.0.0 POM still declares org.jetbrains.kotlin:kotlin-stdlib:2.3.20, confirming it builds against Kotlin 2.3.x.

Environment

  • structured-coroutines: 1.0.0
  • Kotlin: 2.4.0

Request

Please publish a release built against Kotlin 2.4.0 with the FIR extension registration migrated to the new API. For reference, skydoves/compose-stability-analyzer hit the identical issue and fixed it in its 0.9.0 release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions