Follow-up to #53 (repeated-metadata).
Varargs currently surface via @repeated injected into Metadata — queryable through
hasAnnotation[repeated]. Type-level dispatch on varargs requires reading the metadata
tuple structurally.
Proposal (shape TBD)
Maybe introduce dedicated type member on MadeFieldElem:
type IsRepeated <: Boolean & Singleton
def isRepeated: IsRepeated
Would enable type-level dispatch in match types and derivation without scanning Metadata.
Why deferred
@repeated covers introspection
- Mirror normalizes varargs to
Seq[T] so existing builders (fromTuple, fromUnsafeArray)
work without flag
- Niche use case (positional codecs that branch construction by repeated-ness)
- Adding new type member is breaking refinement change — needs concrete demand
Revisit when a positional codec / DSL builder needs to branch on varargs at the type level.
Follow-up to #53 (repeated-metadata).
Varargs currently surface via
@repeatedinjected intoMetadata— queryable throughhasAnnotation[repeated]. Type-level dispatch on varargs requires reading the metadatatuple structurally.
Proposal (shape TBD)
Maybe introduce dedicated type member on
MadeFieldElem:Would enable type-level dispatch in match types and derivation without scanning Metadata.
Why deferred
@repeatedcovers introspectionSeq[T]so existing builders (fromTuple,fromUnsafeArray)work without flag
Revisit when a positional codec / DSL builder needs to branch on varargs at the type level.