SumCaseUplcConstrCommon
Shared base for the two @UplcRepr(UplcConstr)-driven sum-case generators: SumCaseUplcConstrEmitter (Data-compatible) and SumCaseUplcConstrOnlyEmitter (Fun-bearing, no Data side).
Both lower to SumUplcConstr by default and both promote a ProdUplcConstr value into a single-entry SumUplcConstr parent in upcastOne. Subclasses differ on Data-side surface (defaultDataRepresentation, defaultTypeVarReperesentation, canBeConvertedToData), constructor/select/match emission, and outbound conversion (emitConvert).
Attributes
- Graph
-
- Supertypes
- Known subtypes
-
object SumCaseUplcConstrEmitterobject SumCaseUplcConstrOnlyEmitter
Members list
Value members
Abstract methods
Subclass hook: handle representations other than ProdUplcConstr in upcastOne.
Subclass hook: handle representations other than ProdUplcConstr in upcastOne.
Attributes
Concrete methods
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
- Definition Classes
Template method: ProdUplcConstr is always lifted into a single-entry SumUplcConstr parent; everything else is delegated to upcastOneOther.
Template method: ProdUplcConstr is always lifted into a single-entry SumUplcConstr parent; everything else is delegated to upcastOneOther.
Single-entry (no overlay on buildSumUplcConstr) is load-bearing: downstream genMatchUplcConstr.hasTransparentFields walks variants.values, so adding type-derived default variants (whose fields carry Transparent TypeVar reprs from the DataDecl, e.g. List.Cons.head) would fire the transparent-branch override even for concrete-shape inputs like Nil.
Attributes
- Definition Classes
Inherited methods
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
Attributes
- Inherited from:
- SirTypeUplcGenerator
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 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
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.
- already-lowered constructor arguments, in declaration order. Length matches
- optTargetType
-
- optional target type (e.g., for Nil typing where the constr's declared
tpisList[Nothing]).
- optional target type (e.g., for Nil typing where the constr's declared
Attributes
- Inherited from:
- SirTypeUplcGenerator
Attributes
- Inherited from:
- SirTypeUplcGenerator
Attributes
- Inherited from:
- SirTypeUplcGenerator