Scala Meta Live Coding Session
summary
Live codes an annotation macro that reads constructor params and their @get/@post/@patch markers and generates companion case classes for REST models, using Scala Meta 1.8, Scala 2.12 and the scala‑meta‑paradise plugin. The macro creates or updates the companion object, flattens constructor params, groups by annotation (uses annotation names because AST equality is by reference), wraps patch fields in Option, and inserts generated classes; unit tests compile and IntelliJ recognizes the expansion, though incremental recompilation of macros requires manual clean/test.
AI-written summary · about
chapters (27)
- 0:00Intro
- 0:50Scala Meta
- 2:10Scala Macros
- 4:00Promise Code
- 6:50Expectations
- 7:20Macros
- 8:20Macro System
- 9:38Macros Everywhere
- 9:53QuasiCores
- 11:55Using QuasiCores
- 12:12Resources
- 12:23Documentation
- 13:38Problem
- 16:21SBT Project
- 18:32Annotations
- 20:35Companion object
- 22:45Compliation error
- 24:03Creating the case class
- 25:40Parameters
- 26:34Modifiers
- 35:25Inserting Models into Companion Objects
- 39:45Type
- 41:33Test pass
- 42:26Data access layer
- 43:13Update model
- 44:24Plug
- 44:38Question








