1.1.0 — Branching support and improved diagnostics
Highlights
- Branching:
if/elseandswitchcan now appear directly inside a
builder closure — no more hoisting to a switch-expression/helper function
outside the closure. The generated builder implementsbuildEither(first:)
/buildEither(second:)plus a generic single-fieldbuildBlock.- Optional-typed fields need an explicit
else(producingnil) rather
than a bareif— see README's Branching section
for why (buildOptionalisn't implemented; it would double-wrap an
already-Optional field's value).
- Optional-typed fields need an explicit
- Better diagnostics:
- Multiple-initializer errors are now reported once per extra
initializer, each at its own location, instead of a single diagnostic
on the kept initializer. - Unlabeled-parameter errors (
_ name: String) now come with a Fix-It
that promotes the internal name to the label, plus a clearer message.
- Multiple-initializer errors are now reported once per extra
See the updated README for full usage, the branching caveats,
and the complete list of diagnostics.
Compatibility
Fully additive — no breaking changes to the @Mapper macro's existing
generated API. Existing consumers can upgrade from 1.0.0 with no code
changes required.