ProdUplcConstrOps

scalus.compiler.sir.lowering.typegens.ProdUplcConstrOps

Emitter for ProductCaseClassRepresentation.ProdUplcConstr — native UPLC Constr(tag, [t1, t2, ...]) emission for product values.

Owns:

  • genConstr: adopts each argument to its target field representation (canonical LambdaRepresentation for function fields; the @UplcRepr-annotated repr for annotated fields; the field type's natural repr when the type itself carries a class-level @UplcRepr), then assembles a Term.Constr-shaped LoweredValue tagged with the constructor's index.
  • hasClassLevelUplcRepr (private helper): unwraps Annotated / TypeLambda / TypeProxy and returns true when the underlying (CaseClass | SumCaseClass).decl.annotations carry the uplcRepr key.

Called from:

  • ProductCaseEmitter.genConstrLowered (Data-vs-UplcConstr dispatcher);
  • ProductCaseUplcConstrOnlyEmitter, ProductCaseUplcConstrEmitter, SumCaseUplcConstrEmitter, SumCaseUplcConstrOnlyEmitter — all with the same (constr, loweredArgs) signature.

Constructor-handling helpers (retrieveConstrIndex, retrieveConstrDecl) still live on ProductCaseEmitter; called cross-class from here.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def buildProdUplcConstrRepr(tp: SIRType, honorFieldAnnotations: Boolean)(using lctx: LoweringContext): ProdUplcConstr

Builds the ProdUplcConstr repr for product type tp by mapping each constructor parameter to its field-level repr. When honorFieldAnnotations is true (Data-compatible emitter), field-level @UplcRepr annotations override the parameter type's natural repr; otherwise (non-Data emitter) the natural repr is used unconditionally.

Builds the ProdUplcConstr repr for product type tp by mapping each constructor parameter to its field-level repr. When honorFieldAnnotations is true (Data-compatible emitter), field-level @UplcRepr annotations override the parameter type's natural repr; otherwise (non-Data emitter) the natural repr is used unconditionally.

Attributes

def genConstr(constr: Constr, loweredArgs: List[LoweredValue])(using lctx: LoweringContext): LoweredValue