Exploiting Kotlin Metadata + Annotation Processing
summary
Prototype from a year earlier now powers real libraries: about a dozen annotation processors use Kotlin metadata to recover nullability, mutable vs immutable types, type aliases and sealed-class children during annotation processing. A shadowed Kotlin-compiler adapter and protobuf decoding produce an internal model that generators use to emit code that actually compiles — examples include generated “with” extensions for data classes, a Moshi integration merged upstream, and a Room bug fix that reliably preserves parameter names across modules.
AI-written summary · about
chapters (8)
- 0:00Kotlin metadata overview
- 1:23Understanding the metadata
- 4:11Metadata fields and structure
- 8:05Extracting information
- 13:14Practical applications
- 21:25JetBrains API and roadmap
- 25:44Code example demonstration
- 38:00Q&A and closing
related talks
41mAnnotation Processing in a Kotlin World
23mGenerating Kotlin extension functions for Annotation Processing
39mAnnotation processing for Kotlin done right
25mArrow Meta - Enabling Functional Programming in the Kotlin Compiler
36mFact or kapt? Build your next annotation processor with KSP
28mMetaprogramming with Kotlin Symbol Processing
15mOn the Applicability of Annotation-Based Source Code Modification in Kotlin (Work...
41mGenerating Kotlin Code
