Home / Companies / JetBrains / Blog / Post Details
Content Deep Dive

The Companions to Come - The JetBrains Blog

Blog post from JetBrains

Post Details
Company
Date Published
Author
Alejandro Serrano Mena
Word Count
627
Company Posts That Month
47
Language
American English
Hacker News Points
-
Post removed?
No
Summary

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.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

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.