RecordBuilderMacro

dev.constructive.eo.avro.vulcan.RecordBuilderMacro

The macro behind AvroVulcan.recordBuilder — walks A's case fields at EXPANSION and emits the WholeRecordBuilder.RecordShape the runtime assembly resolves against the codec's schema.

The macro's whole job is classification: it never emits per-field code. Each case field becomes one WholeRecordBuilder.FieldShape arm —

Because the emitted value is plain data, everything schema-dependent (slot resolution, arm validation) happens at builder construction in WholeRecordBuilder.derive — ordinary testable Scala, no staged code. The whole classification lives in builderImpl as local defs under ONE Quotes: TypeRepr / Symbol are path-dependent on the Quotes instance, so a (using Quotes)-taking helper called from inside a quote would type against a different path.

Attributes

Source
RecordBuilderMacro.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def builderImpl[A](codec: Expr[Codec[A]])(using evidence$1: Type[A], Quotes): Expr[Exception | WholeRecordBuilder[A]]

Entry: AvroVulcan.recordBuilder[A]. Requires a case class A (sums encode through their codec, not a builder) and the in-scope vulcan.Codec[A] whose schema the builder writes.

Entry: AvroVulcan.recordBuilder[A]. Requires a case class A (sums encode through their codec, not a builder) and the in-scope vulcan.Codec[A] whose schema the builder writes.

Attributes

Source
RecordBuilderMacro.scala