ProdDataListOps

scalus.compiler.sir.lowering.typegens.ProdDataListOps

Emitter for ProductCaseClassRepresentation.ProdDataList and the wider Data-shape product family (ProdDataConstr, PackedDataList, PairIntDataList) — they all share the unConstrData/headList/tailList extraction pattern and converge on ProdDataList for Match.

Owns:

  • genConstr (Data-list-shaped Constr emission).
  • genSelect (field projection through ProdDataList).
  • genMatch (single-constructor extraction; multi-case input is shrunk via selectMatchCase, then handed to DataConstrEmitter.genMatchDataConstrCase for the actual binding + body lowering).

Constructor-handling helpers (retrieveConstrDecl, retrieveConstrIndex, selectMatchCase) still live on ProductCaseEmitter during the Phase 4c migration — they're shared with ProdBuiltinPairOps and several Sum-side typegens.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def genConstr(constr: Constr, loweredArgs: Seq[LoweredValue], argTypeGens: Seq[SirTypeUplcGenerator])(using lctx: LoweringContext): LoweredValue

Data-list-shaped Constr emission: convert each arg to its data form, fold into a mkCons chain, wrap as a ProdDataList-tagged value carrying constr.tp as the SIR type.

Data-list-shaped Constr emission: convert each arg to its data form, fold into a mkCons chain, wrap as a ProdDataList-tagged value carrying constr.tp as the SIR type.

Attributes

def genMatch(matchData: Match, loweredScrutinee: LoweredValue, optTargetType: Option[SIRType])(using lctx: LoweringContext): LoweredValue

Match emission on a Data-shape product scrutinee. For >1-case input the applicable case is selected via ProductCaseEmitter.selectMatchCase and the rest are statically dropped (info-logged). Single-case input flows directly to DataConstrEmitter.genMatchDataConstrCase, which owns the actual field-extraction + body-lowering inside the Data list scope.

Match emission on a Data-shape product scrutinee. For >1-case input the applicable case is selected via ProductCaseEmitter.selectMatchCase and the rest are statically dropped (info-logged). Single-case input flows directly to DataConstrEmitter.genMatchDataConstrCase, which owns the actual field-extraction + body-lowering inside the Data list scope.

Attributes

def genSelect(sel: Select, loweredScrutinee: LoweredValue)(using lctx: LoweringContext): LoweredValue

Field projection on a Data-shape product: convert the scrutinee to ProdDataList, then walk to the chosen field via dropList (V4+, fieldIdx ≥ 2) or chained tailList (V1-V3 / fieldIdx < 2), and read with headList.

Field projection on a Data-shape product: convert the scrutinee to ProdDataList, then walk to the chosen field via dropList (V4+, fieldIdx ≥ 2) or chained tailList (V1-V3 / fieldIdx < 2), and read with headList.

Attributes