Loading…
Topic
Companion Blocks
1 post about Companion Blocks. Every summary links to the original.
- 1 post
- 1 company
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
The Companions to Come
JetBrains is extending Kotlin’s companion mechanism with experimental companion blocks and companion extensions in Kotlin 2.5.0. Companion blocks replace the object keyword with a companion block, compiling members as static members on the JVM. Companion extensions allow adding class-level members to any type, even types the developer does not control. These features improve multiplatform interoperability by enabling expected companion block members to be actualized using Java static members. Companion objects remain fully supported and are still required when the companion must implement an interface, but companion blocks are recommended for new code.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.