The Companions to Come - The JetBrains Blog
Blog post from JetBrains
Kotlin 2.5.0-Beta1 introduces experimental companion blocks and companion extensions, intended to expand on companion objects by supporting class-level constants, utilities, factories, and externally declared members with compilation behavior closer to static members on other platforms. Companion blocks can compile to JVM static members, while companion extensions can add class-level functionality to Kotlin or Java classes and interfaces regardless of whether their source is controlled or they already have a companion object. These features also improve Kotlin Multiplatform interoperability by allowing expected companion block members to be actualized through Java classes with static members. Developers must enable them with compiler flags, and companion extensions currently produce pre-release binaries that cannot generally be used as library dependencies until stabilization. Companion objects remain fully supported and are still necessary when the companion must implement an interface, while migration to companion blocks is often as simple as removing the object keyword, provided dependent projects are recompiled and supporting tooling is available.
No tracked trend matches for this post yet.
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.