MacroSelectors
Quote-context selector-AST helpers shared between LensMacro and the JsonPrismMacro / AvroPrismMacro cursor macros. All parse single-field selector lambdas (_.fieldName) and validate non-duplicates; the per-macro divergence is just the error-message tag.
Attributes
- Source
- MacroSelectors.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
MacroSelectors.type
Members list
Value members
Concrete methods
Validate a Dynamic-sugar literal field name against A's case-class schema. Returns the field name, its declaration index in A, and its widened TypeRepr; aborts with a who-tagged error when the name isn't a compile-time literal or A has no such case field. Shared backbone of the cursor macros' selectDynamic sugar — the caller owns the module-specific codec summon + emit.
Validate a Dynamic-sugar literal field name against A's case-class schema. Returns the field name, its declaration index in A, and its widened TypeRepr; aborts with a who-tagged error when the name isn't a compile-time literal or A has no such case field. Shared backbone of the cursor macros' selectDynamic sugar — the caller owns the module-specific codec summon + emit.
Attributes
- Source
- MacroSelectors.scala
Loose variant of extractSingleFieldName — strips Inlined / Typed wrappers around the lambda AND around its Select body, and does NOT require the Select receiver to be the bare lambda parameter. Used by the cursor macros' .field(_.x) sugar, whose selectors are always single-hop but may arrive wrapped. Kept distinct from extractSingleFieldName (which rejects nested chains by construction) so callers that need the strict form still have it.
Loose variant of extractSingleFieldName — strips Inlined / Typed wrappers around the lambda AND around its Select body, and does NOT require the Select receiver to be the bare lambda parameter. Used by the cursor macros' .field(_.x) sugar, whose selectors are always single-hop but may arrive wrapped. Kept distinct from extractSingleFieldName (which rejects nested chains by construction) so callers that need the strict form still have it.
Attributes
- Source
- MacroSelectors.scala
Strips Inlined / Typed wrappers and peeks inside the lambda body for a single Select whose receiver is exactly the lambda parameter (an Ident). Receiver-is-Ident is load-bearing — nested paths like _.a.b parse as Select(Select(Ident(_), "a"), "b") and fall through to None so each macro can produce its own "nested paths" message.
Strips Inlined / Typed wrappers and peeks inside the lambda body for a single Select whose receiver is exactly the lambda parameter (an Ident). Receiver-is-Ident is load-bearing — nested paths like _.a.b parse as Select(Select(Ident(_), "a"), "b") and fall through to None so each macro can produce its own "nested paths" message.
Attributes
- Source
- MacroSelectors.scala
Validate a .fields(_.a, _.b, …) varargs selector list against A's case-class schema and synthesise the SELECTOR-order NamedTuple type: arity ≥ 2, single-hop selectors only, known fields, no duplicates. Returns the selected names (selector order), their declaration indices in A (declaration order lookup — the field-schema-naming resolution of issue #35), and the NamedTuple[names, values] TypeRepr. Shared backbone of AvroPrismMacro.fieldsCommon / JsonPrismMacro.fieldsCommon — the caller owns the module-specific codec summon + emit.
Validate a .fields(_.a, _.b, …) varargs selector list against A's case-class schema and synthesise the SELECTOR-order NamedTuple type: arity ≥ 2, single-hop selectors only, known fields, no duplicates. Returns the selected names (selector order), their declaration indices in A (declaration order lookup — the field-schema-naming resolution of issue #35), and the NamedTuple[names, values] TypeRepr. Shared backbone of AvroPrismMacro.fieldsCommon / JsonPrismMacro.fieldsCommon — the caller owns the module-specific codec summon + emit.
Attributes
- Source
- MacroSelectors.scala
The single element type of a Scala collection type A (via its Iterable base type), or abort with a who-tagged error. Shared by the cursor macros' .at / .each sugar.
The single element type of a Scala collection type A (via its Iterable base type), or abort with a who-tagged error. Shared by the cursor macros' .at / .each sugar.
Attributes
- Source
- MacroSelectors.scala
Reject duplicate field names; aborts on the first duplicate. The who tag prefixes the message.
Reject duplicate field names; aborts on the first duplicate. The who tag prefixes the message.
Attributes
- Source
- MacroSelectors.scala