SumListEmitterCommon

scalus.compiler.sir.lowering.typegens.SumListEmitterCommon
See theSumListEmitterCommon companion object

handle next cases: scalus.cardano.onchain.plutus.prelude.List[A] scalus.uplc.builtin.BuiltinList[A] scalus.cardano.onchain.plutus.prelude.PairList[A, B]

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def genNil(resType: SIRType, pos: SIRPosition)(using LoweringContext): LoweredValue

mkNilData and mkNilPairData

mkNilData and mkNilPairData

Attributes

Concrete methods

override def canBeConvertedToData(tp: SIRType)(using lctx: LoweringContext): Boolean

Attributes

Definition Classes
def emitConvert(input: LoweredValue, outputRepresentation: LoweredValueRepresentation, pos: SIRPosition)(using lctx: LoweringContext): LoweredValue

Outbound conversions from a list-shaped value (Phase 5). The receiver this is the source emitter — SumBuiltinListEmitter(elemRepr) for cons-list sources, SumPairBuiltinListEmitter for pair-list sources.

Outbound conversions from a list-shaped value (Phase 5). The receiver this is the source emitter — SumBuiltinListEmitter(elemRepr) for cons-list sources, SumPairBuiltinListEmitter for pair-list sources.

Body lifted from SumDispatch.sumListCommonImpl: the previous gen parameter is now this. Targets covered: SumBuiltinList variants, PackedSumDataList, SumPairBuiltinList variants, SumDataAssocMap, plus cross-class delegations for SumUplcConstr / ProdUplcConstr / SumReprProxy and the PairIntDataList rebuild path.

Attributes

def fixNilInConstr(input: LoweredValue, targetListType: SIRType, targetRepr: LoweredValueRepresentation)(using lctx: LoweringContext): LoweredValue
override def genConstrLowered(constr: Constr, loweredArgs: List[LoweredValue], optTargetType: Option[SIRType])(using lctx: LoweringContext): LoweredValue

Generate constructor for this type — the workhorse, takes pre-lowered arguments. Implementations override this. Always called on DataDecl.tp (or a more specific case-class type for Sum→Product dispatch).

Generate constructor for this type — the workhorse, takes pre-lowered arguments. Implementations override this. Always called on DataDecl.tp (or a more specific case-class type for Sum→Product dispatch).

Value parameters

constr
  • constructor SIR node (carries name, decl, parentTypeArgs, anns, tp)
loweredArgs
  • already-lowered constructor arguments, in declaration order. Length matches constr.args.
optTargetType
  • optional target type (e.g., for Nil typing where the constr's declared tp is List[Nothing]).

Attributes

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

Attributes

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

Attributes

Definition Classes
def isBuiltinList(tp: SIRType): Boolean
def isNilType(tp: SIRType): Boolean
override def upcastOne(input: LoweredValue, targetType: SIRType, pos: SIRPosition)(using lctx: LoweringContext): LoweredValue

Attributes

Definition Classes

Inherited methods

final def genConstr(constr: Constr, optTargetType: Option[SIRType] = ...)(using lctx: LoweringContext): LoweredValue

Convenience entry point — pre-lowers constr.args and delegates to genConstrLowered. Use this when the caller hasn't already lowered the arguments; callers that have pre-lowered arguments (like the main lowering driver) should call genConstrLowered directly to avoid double-lowering. Marked final so all dispatch decisions live in genConstrLowered and its overrides.

Convenience entry point — pre-lowers constr.args and delegates to genConstrLowered. Use this when the caller hasn't already lowered the arguments; callers that have pre-lowered arguments (like the main lowering driver) should call genConstrLowered directly to avoid double-lowering. Marked final so all dispatch decisions live in genConstrLowered and its overrides.

Attributes

Inherited from:
SirTypeUplcGenerator

Inherited and Abstract methods

Get default representation for data representation of this type. This representation is used when converting to data instrucutres, which holds value as data.

Get default representation for data representation of this type. This representation is used when converting to data instrucutres, which holds value as data.

Attributes

Inherited from:
SirTypeUplcGenerator

Get default representation. Assumed that input parameters of functions and vars and are in this representation.

Get default representation. Assumed that input parameters of functions and vars and are in this representation.

Attributes

Inherited from:
SirTypeUplcGenerator

Get default representation for type variable. This representation is used when converting to parameters of scala functions with type parameters. (Usually the same as defaultDataRepresentation, except Lambdas).

Get default representation for type variable. This representation is used when converting to parameters of scala functions with type parameters. (Usually the same as defaultDataRepresentation, except Lambdas).

Attributes

Inherited from:
SirTypeUplcGenerator